The one that's interesting I think is the combination of interval used to run a cron job.
For example if you want to run a job every minute you can use this line of command:
* * * * * /opt/some-script.shall those five "*" symbols have their own meaning:
# field # meaning allowed values # ------- ------------ -------------- # 1 minute 0-59 # 2 hour 0-23 # 3 day of month 1-31 # 4 month 1-12 (or names, see below) # 5 day of week 0-7 (0 or 7 is Sun, or use names)
For example when you want to 5 minutes after every hour:
# this command will run at 12:05, 1:05, etc. 5 * * * * /usr/bin/some-script.sh
For crontab to run everyday at 4.30 am
30 4 * * * /opt/bin/some-script.sh
If you want to run a cron job every 5 minutes you can use this command:
*/5 * * * * /var/opt/bin/somescript.sh
Recently, I just found out a website that can check a cronjob and give the meaning
http://cronchecker.net/
All the examples above are taken from this web
For additional examples you can check this web
Anyway, if you're not sure about the cron job you created, you can just cross-reference with cronchecker website.
No comments:
Post a Comment