Skip to content

jonathonmcclen/mac-linux-admin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Getting Started

Pull fork or copy the scripts of your choice.

Most of the scripts in this repo work out of the box but can be modified to your liking.

Create a Bash Script: Create a new file with a .sh extension. For example, clean_desktop.sh.

(or just copy a file from the repo)

# paste bash code from your script of choice

How to make executable

Make the Script Executable: Open a terminal and run:

chmod +x /path/to/your/clean_desktop.sh

Replace /path/to/your/clean_desktop.sh with your actual script path.

Scheduling the Script with Cron

  1. Edit Cron Jobs: Open your crontab for editing:

    crontab -e
  2. Add Cron Job: Add a line to schedule your Bash script. For example, to run the script every day at 3 AM:

    0 3 * * * /path/to/your/clean_desktop.sh

    This line specifies the minute (0), hour (3), every day of the month (), every month (), and every day of the week (*).

  3. Save and Exit: Save your crontab file and exit the editor.

Example Cron Schedule Expressions

  • 0 3 * * * - Every day at 3 AM
  • 0 */2 * * * - Every 2 hours
  • 0 0 * * 0 - Every Sunday at midnight
  • */5 * * * * - Every 5 minutes

Admin Scripts in this repo

auto-sync.sh

auto-sync is used to sync two folders to be duplicates of one another.

in order to run this at startup on on a CRON schedule read

backup.sh

backup.sh is a bash script that is used to back up a directory of your choice to a destination. the script wil label the backup with a date. so if you run it mor than once it will create a new backup with the new timestamp

if you are looking for continuous back up in a single folder you are looking for auto-sync.sh

clean-desktop.sh

clean desktop is a simple script to clean your desktop of standard file extensions. jpg, png, mp4, pdf, etc... will be moved to files of your choosing ( mac standard folders music, pictures, movies, documents recommended )

desktop2.sh

when first run will create a new directory called desktop2 that will be a sibling of the standard desktop. the script will then move all filed from desktop to desktop2

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages