bigmike7801
bigmike7801

Reputation: 3970

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.

Upvotes: 3

Views: 1155

Answers (2)

user979339
user979339

Reputation:

'*/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

Upvotes: 4

Jon Lin
Jon Lin

Reputation: 143876

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

Upvotes: 2

Related Questions