Linux ubuntu cron dont run - no script executed from cron
Hi, I've been using linux for some time and after installing Ubuntu Mate on a Raspberry Pi I have an interesting problem with cron.
I have several scheduled scripts in cron and none will run. Don't know what it is?
Cron is running:
Thanks
Hi,
Two possibilities come to mind:
1.) It may be a known bug cron (I don't know if it's already fixed) = crontab must be terminated with a new line otherwise nothing will be done, so this should be enough:
2.) If you have more complicated tasks there with quotes and variables, such as the backup of the MySQL database, then it is better to put it in one file as a script. Try and see ...
3.) Add PATH + SHELL to crontab -e
I have several scheduled scripts in cron and none will run. Don't know what it is?
Cron is running:
pgrep cron
=> 775. crontab -e
MAILTO = ""
# m h dom mon dow command
0 22 * * * rdiff-backup / mnt / data / www / mnt / blackburn / backups / rdiff_www
2 22 * * * zip -r /mnt/blackburn/backups/data.zip / mnt / data / data -x '* jpg *'
44 23.11 * * * name = $ (date '+% y-% m-% d-% H-% M'); mysqldump -u root -pheslo --all-databases | gzip -9> /mnt/blackburn/backups/mysql/$name.all.sql.gz;
Thanks
REPLY
Hi,
Two possibilities come to mind:
1.) It may be a known bug cron (I don't know if it's already fixed) = crontab must be terminated with a new line otherwise nothing will be done, so this should be enough:
crontab -e
MAILTO=""
# m h dom mon dow command
0 22 * * * rdiff-backup /mnt/data/www /mnt/blackburn/backups/rdiff_www
2 22 * * * zip -r /mnt/blackburn/backups/data.zip /mnt/data/data -x '*jpg*'
44 23,11 * * * name=$(date '+%y-%m-%d-%H-%M');mysqldump -u root -pheslo --all-databases | gzip -9 > /mnt/blackburn/backups/mysql/$name.all.sql.gz;
2.) If you have more complicated tasks there with quotes and variables, such as the backup of the MySQL database, then it is better to put it in one file as a script. Try and see ...
3.) Add PATH + SHELL to crontab -e
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin
MAILTO=""