Tuesday, 31 July 2018

linux - Different time specification formats with crontab


Say you want to run a job every 30 minutes on linux (or osx) using crontab. Sometimes I see the the sytax written like this:


30 * * * * /path/to/job


and sometimes I see it written like


*/30 * * * * /path/to/job


Are those two lines equivalent? (They seem to be based on my tests). Are there any differences?



Answer



They shouldn't behave identically. The first line tells crontab to execute the job 30 minutes past every hour (i.e. 5:30, 6:30, 7:30 ...), while the second line tells crontab to execute the job every 30 minutes (i.e. 5:00, 5:30, 6:00, 6:30 ...)


You can check the crontab man page for detailed instructions.


No comments:

Post a Comment

Where does Skype save my contact's avatars in Linux?

I'm using Skype on Linux. Where can I find images cached by skype of my contact's avatars? Answer I wanted to get those Skype avat...