You are not logged in.
Pages: 1
I have a daily backup job which used to run just fine. But now when cron starts running the job, it re-runs it every 10 minutes after. Obviously the long backup job overlaps with the others started after it and it causes all sorts of problems. When I last checked it was running 11 copies of the backup process! I had to kill them all manually. What the hell is going on?
Offline
Show us the cron file and the script it is running.
Philosophy is looking for a black cat in a dark room. Metaphysics is looking for a black cat in a dark room that isn't there. Religion is looking for a black cat in a dark room that isn't there and shouting "I found it!". Science is looking for a black cat in a dark room with a flashlight.
Offline
I just have a symlink in /etc/cron.daily to the backup script, which looks like this:
#!/bin/bash
rm -f /mnt/storage1/system.tar.gz
tar czf /mnt/storage1/system.tar.gz /bin /boot /etc /home /lib /lib64 /opt /root /sbin /srv /usr /var/log
python /home/shaurz/syncdirs.py /mnt/storage1 /mnt/storage1_backup --commit --logfile=/home/shaurz/backup1.log &
job1=$!
python /home/shaurz/syncdirs.py /mnt/storage2 /mnt/storage2_backup --commit --logfile=/home/shaurz/backup2.log &
job2=$!
wait $job1
wait $job2
sync
Offline
By the way, this is dcron and there is no crontab
Offline
By the way, this is dcron and there is no crontab
There most definitely should be. Those directories aren't magic.
$ sudo crontab -l -u root
# root crontab
# DO NOT EDIT THIS FILE MANUALLY! USE crontab -e INSTEAD
# man 1 crontab for acceptable formats:
# <minute> <hour> <day> <month> <dow> <tags and command>
# <@freq> <tags and command>
# SYSTEM DAILY/WEEKLY/... FOLDERS
@hourly ID=sys-hourly /usr/sbin/run-cron /etc/cron.hourly
@daily ID=sys-daily /usr/sbin/run-cron /etc/cron.daily
@weekly ID=sys-weekly /usr/sbin/run-cron /etc/cron.weekly
@monthly ID=sys-monthly /usr/sbin/run-cron /etc/cron.monthly
Offline
Well it worked without a crontab (the package does not include a default one).
I ran sudo crontab -l -u root and got the same output:
# root crontab
# DO NOT EDIT THIS FILE MANUALLY! USE crontab -e INSTEAD
# man 1 crontab for acceptable formats:
# <minute> <hour> <day> <month> <dow> <tags and command>
# <@freq> <tags and command>
# SYSTEM DAILY/WEEKLY/... FOLDERS
@hourly ID=sys-hourly /usr/sbin/run-cron /etc/cron.hourly
@daily ID=sys-daily /usr/sbin/run-cron /etc/cron.daily
@weekly ID=sys-weekly /usr/sbin/run-cron /etc/cron.weekly
@monthly ID=sys-monthly /usr/sbin/run-cron /etc/cron.monthly
But the /etc/crontab file doesn't exist... is it stored somewhere else?
Last edited by shaurz (2010-10-12 23:16:24)
Offline
dcron contains /var/spool/cron/root what is a default crontab.
Offline
https://bugs.archlinux.org/task/18681
To work around the bug I modified root's crontab as follows
40 * * * * /usr/sbin/run-cron /etc/cron.hourly
15 0 * * * /usr/sbin/run-cron /etc/cron.daily
30 2 * * 0 /usr/sbin/run-cron /etc/cron.weekly
20 4 1 * * /usr/sbin/run-cron /etc/cron.monthly
# SYSTEM DAILY/WEEKLY/... FOLDERS
#@hourly ID=sys-hourly /usr/sbin/run-cron /etc/cron.hourly
#@daily ID=sys-daily /usr/sbin/run-cron /etc/cron.daily
#@weekly ID=sys-weekly /usr/sbin/run-cron /etc/cron.weekly
#@monthly ID=sys-monthly /usr/sbin/run-cron /etc/cron.monthly
Last edited by skunktrader (2010-10-12 23:43:07)
Offline
Thanks for the workaround, I should have checked the bug tracker first.
Offline
Pages: 1