A
A
Alexander Verbitsky2019-04-18 09:51:05
ubuntu
Alexander Verbitsky, 2019-04-18 09:51:05

How to correctly set the time in cron?

I need an update at one in the morning, every two days, am I setting it right?
* 1 */2 * *
And yet, can I write a script there? type:
* */2 * * * sudo indextr -- all --rotate
Or won't it work?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
D
Dmitry, 2019-04-18
@LazyTalent

crontab guru

J
Janus74, 2019-04-18
@Janus74

0 1 * * * command
regarding scripts, it is recommended to place them in an executable file, and add the file to cron

R
Rsa97, 2019-04-18
@Rsa97

In general, it is correct, only every even number of the month will be called. At the end of a long month there will be an interval of three days.
If you register in the system cron (/etc/crontab), then sudo is not necessary, you can immediately run the command as root.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question