Cron jobs are simply bash scripts that run when you boot up your computer and when certain time conditions have been met. For them, you write your script, save it, and then run a command to add a new cron job that points to the location of the newly-saved script.
Once you’ve created the script, you’ll need to create a .txt file that uses the following format: 0-60 , 0-23 , 1-31 , 1-12 , 0-7 , and then the path of the script. For each position where the value doesn’t matter (such as the day of the week), you can just replace the number with an asterisk. Then run crontab /path/to/file.txt, obviously replacing the path with the actual one. You’ve now set up a cron job!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s