Cron is a time-based job scheduler in Linux and Unix.
Read the manual:
Load your personal crontab (cron table) file:
View your personal crontab:
|min||hour||day of month||month||day of week||command|
|0 – 59||0 – 23||1 – 31||1 – 12||0 – 6 (0 to 6 are Sunday to Saturday)||shell command you want to run at that time|
*/Nis the syntax for an interval
- You can use commas if the interval is irregular
Time Syntax Examples
||Run Monday through Friday at 9am server time|
||Run every day at 3pm server time|
||Run every 2 hours, on the half hour|
||Run once a year at midnight on January 1|
||Run daily at 3am, 7am, noon, and 6pm|
Download a JSON file from Quandl and overwrite GOLD.json with it Monday through Friday at 5pm server time:
Things to look out for
- Surround anything with possible odd characters or spaces with quotes: URLs, local file paths, etc. This will keep you from getting errors.
- Use a full file path from root instead of
~/– Tildes aren’t interpreted the same way as on the command line
- Times are always in server time. If you don’t know what time it is on the server, run:
Thanks goes out to Eric Davis for helping me out with this!
Leave a Reply