Answer the question
In order to leave comments, you need to log in
Is the job for CronTab correct?
Hello! Is the task for Crontab correctly compiled, which will run the /etc/backup.sh script as root every day?
I run crontab as root with the commandcrontab -e
0 0 * * * /bin/bash /etc/backup.sh >/dev/null 2>&1
Answer the question
In order to leave comments, you need to log in
Don't do tasks as root.
Remove the path to the shell from the command, configure the cron normally, for example, see the article www.codenet.ru/webmast/php/cron.php
If something does not work for you, then show the error from the logs.
basically correct.
But placing scripts in /etc is bad manners.
PS. In general, you just need to place a link to your script in /etc/cron.daily and it will be executed at 4:02 every day
I will add: a very vague concept is correct. For example, we can talk about the cron schedule.
It can be checked in at least two ways:
1. Get a grasp of the man to crontab
2. Use online services that can decrypt the cron format. For example:
- https://crontab.cronbox.ru
- https://crontab.guru
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question