You are not logged in.
So, since I'm desperate by now I'm posting this issue here:
I set up my backup using rsnapshot which actually works alright. I'm using sync_first 1 because I'm doing offsite backups from remote servers and my connection is not the most reliable. Running "rsnapshot sync" and "rsnapshot daily" works alright but I just can't seem to make cron run them. I'm aware of cron's minimal env and thus I made sure it had everything it needed:
cat /etc/cron.d/rsnapshot
30 8 * * * root /usr/bin/rsnapshot sync 2>&1 > /dev/null
30 16 * * * root /usr/bin/rsnapshot daily 2>&1 > /dev/null
40 16 * * 6 root /usr/bin/rsnapshot weekly 2>&1 > /dev/null
Absolute paths and made sure that no output gets printed (which would result in a mail).
cat /var/log/crond|grep rsnapshot
10-Aug-2009 08:30 FILE /etc/cron.d/rsnapshot USER root pid 17638 cmd root /usr/bin/rsnapshot sync 2>&1 > /dev/null
So the cron job runs, great!
tail /var/log/rsnapshot
[08/Aug/2009:23:07:56] touch /media/backup/.sync/
[08/Aug/2009:23:07:56] rm -f /var/run/rsnapshot.pid
[08/Aug/2009:23:07:56] /usr/bin/rsnapshot sync: completed successfully
[09/Aug/2009:00:59:36] /usr/bin/rsnapshot daily: started
[09/Aug/2009:00:59:36] echo 31210 > /var/run/rsnapshot.pid
[09/Aug/2009:00:59:36] /bin/cp -al /media/backup/.sync /media/backup/daily.0
[09/Aug/2009:01:00:26] rm -f /var/run/rsnapshot.pid
[09/Aug/2009:01:00:26] /usr/bin/rsnapshot daily: completed successfully
The last backup was run manually, the cron one didn't run at all. Mh
Does anybody have any ideas?
Offline
Anybody? This is kind of important
Offline
Just a thought... Stop redirecting the output to /dev/null so you can see any error messages?
Yes it will generate mail, but it's the only way you're going to potentially see the problem.
Last edited by fukawi2 (2009-08-12 05:37:27)
Are you familiar with our Forum Rules, and How To Ask Questions The Smart Way?
BlueHackers // fscanary // resticctl
Offline
I did and the file is created (I made it output to /tmp/lol.log) but it is empty .
Offline
Does rsnapshot have a verbose option to get it to tell you what it's problem is?
Are you familiar with our Forum Rules, and How To Ask Questions The Smart Way?
BlueHackers // fscanary // resticctl
Offline
Yup, and it certainly is verbose when run in a terminal. Produces no output whatsoever when run by cron.
Offline
I think I fixed the problem by putting all my stuff into root's crontab. It isn't the solution I had hoped for but at least it is working. Thanks for helping though.
I'm left wondering why stuff in /etc/cron.d/ won't execute correctly.
Offline