Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is `*/1 * * * *` and `* * * * *` equivalent in CRON?

Tags:

cron

crontab

As I have recently seen something like

*/1 * * * * ./script.py

I would like to know if it means the same as

* * * * * ./script.py
like image 948
Martin Thoma Avatar asked Feb 25 '14 11:02

Martin Thoma


People also ask

What is * * * * * In cron job?

What does * mean in Cron? The asterisk * is used as a wildcard in Cron. * sets the execution of a task to any minute, hour, day, weekday, or month.

What is cron time format?

The UNIX cron format is used to specify time in the schedule parameter of the ADMIN_TASK_ADD and ADMIN_TASK_UPDATE procedures. The cron format has five time and date fields separated by at least one blank. There can be no blank within a field value.

Is cron expression 5 or 6 fields?

A cron expression is a string consisting of six or seven subexpressions (fields) that describe individual details of the schedule. These fields, separated by white space, can contain any of the allowed values with various combinations of the allowed characters for that field.

What is the difference between cron and crontab?

hourly, cron. monthly, cron. weekly are self-explanatory, they contain scripts executed every hour, every month and every week of the year; crontab: a cron file written with cron syntax that instructs the cron service to run jobs located in the daily, hourly, monthly and weekly folders.


1 Answers

Yes, it does.

*/X means: every X minutes * means: every minute

So all together */1 means exactly the same as *.


From man cron:

Step values can be used in conjunction with ranges. Following a range with /number specifies skips of the number's value through the range. For example, 0-23/2'' can be used in the hours field to specify command execution every other hour (the alternative in the V7 standard is 0,2,4,6,8,10,12,14,16,18,20,22'').

Steps are also permitted after an asterisk, so if you want to say every two hours'', just use */2''.

like image 132
fedorqui 'SO stop harming' Avatar answered Sep 20 '22 16:09

fedorqui 'SO stop harming'