You are not logged in.

#1 2009-08-10 09:50:18

Svenstaro
Administrator
From: Germany
Registered: 2008-11-19
Posts: 388

Why, oh why, doesn't my backup work? (rsnapshot)

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 hmm

Does anybody have any ideas?

Offline

#2 2009-08-12 02:39:45

Svenstaro
Administrator
From: Germany
Registered: 2008-11-19
Posts: 388

Re: Why, oh why, doesn't my backup work? (rsnapshot)

Anybody? This is kind of important hmm

Offline

#3 2009-08-12 05:36:55

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,222
Website

Re: Why, oh why, doesn't my backup work? (rsnapshot)

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)

Offline

#4 2009-08-12 07:16:58

Svenstaro
Administrator
From: Germany
Registered: 2008-11-19
Posts: 388

Re: Why, oh why, doesn't my backup work? (rsnapshot)

I did and the file is created (I made it output to /tmp/lol.log) but it is empty sad.

Offline

#5 2009-08-12 08:49:18

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,222
Website

Re: Why, oh why, doesn't my backup work? (rsnapshot)

Does rsnapshot have a verbose option to get it to tell you what it's problem is?

Offline

#6 2009-08-12 09:04:44

Svenstaro
Administrator
From: Germany
Registered: 2008-11-19
Posts: 388

Re: Why, oh why, doesn't my backup work? (rsnapshot)

Yup, and it certainly is verbose when run in a terminal. Produces no output whatsoever when run by cron.

Offline

#7 2009-08-12 09:40:11

Svenstaro
Administrator
From: Germany
Registered: 2008-11-19
Posts: 388

Re: Why, oh why, doesn't my backup work? (rsnapshot)

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

Board footer

Powered by FluxBB