简体   繁体   中英

What's the difference between these two crontab settings?

I'm looking at a crontab on a linux server and came accross the following line

*/1 * * * * /path/to/file

To me this means run the cron every 1 minute right?

What makes it different from this?

* * * * * /path/to/file

I'm fairly new to Linux crontab so hopefully this isn't a dumb question.

'*/1' is a step definition and means every minute; it is identical to the second format .

If you would want to do something every 2 hours, you could do this:

* */2 * * * /path/to/file

See: (search for the word "Ranges")

man 5 crontab

There's no difference. The cron scheduler sees them both as 1 minute from the last run.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM