There is a record:
45 * * * 1 script.sh and
45 0-23 * * 1 script.sh The desired effect is to run the script 45 minutes after every hour on Mondays.
Are they identical? If not, what is the difference?
There is a record:
45 * * * 1 script.sh and
45 0-23 * * 1 script.sh The desired effect is to run the script 45 minutes after every hour on Mondays.
Are they identical? If not, what is the difference?
They both work. However, I would personally prefer:
45 * * * mon script.sh As it is more readable, and more immediately understandable without having to remember which day of the week is '1'.
mon as a day name is a GNU extension to standard crontab. It's not likely available on non-GNU systems. They are identical but prefered to use first variant, there is less chance to get confused. Generally with its syntax is easy to get confused, here is a some typical mistakes with cron.