Answer the question
In order to leave comments, you need to log in
How to make conditions for cron task?
Good afternoon dear experts.
Help solve this problem. There is a script to automate the deployment of a virtual host. The script should run on it. But executing this script interrupts the cron task.
This type of task
*/10 * * * * root timeout -k 1m 10m 900 ansible-pull $OPTS
*/10 * * * * root [ условие ] || timeout -k 1m 10m 900 ansible-pull $OPTS
Answer the question
In order to leave comments, you need to log in
Can't these two operations be placed in one cron job?
In general, of course, you can check for the existence of a process. I would write a small script that creates a lock file before starting and deletes or renames it at the end.
Can.
I have this line in my crontab:
Checks if today is a working day, if yes, then starts the music as an alarm
*/10 * * * * root [ условие ] || timeout -k 1m 10m 900 ansible-pull $OPTS
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question