[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Question about backuping multiply dirs



I suspect your cron isn't working as you haven't specified the full paths.
Theres no $PATH in cron, so you need to specify the full path to every binary you call.

I suspect your cron should actually be:
00 03 * * * /usr/bin/tarsnap -c -f backup-`/bin/date +\%Y\%m\%d` /etc /var/www/vhosts

As Tim says, it looks like the backups you're seeing are a red heron from an old trial or something.

On 30 October 2011 23:42, Tim Bishop <tim-lists@bishnet.net> wrote:
Based on the date of the mybackup archive it's an old one, so it looks
like your cron job isn't running. I'd have expected it to produce an
error - is there nothing in the cron email or logs?

What happens if you run your exact cron command on the command line?

tarsnap -c -f backup-`date +\%Y\%m\%d` /etc /var/www/vhosts

(for what it's worth, I don't think you need the back slashes there)

Does it work? If so, does it appear in --list-archives? If so, does it
contain the right files?

If it doesn't work, what error does it generate?

Tim.

On Mon, Oct 31, 2011 at 12:14:41AM +0100, Amar Cosic wrote:
> root@lemon:/etc# tarsnap --list-archives -vv
> test.london   2011-10-30 12:36:36     tarsnap -c -f test.london /etc
> mybackup      2011-09-03 16:42:00     tarsnap -c -f mybackup /etc/
>
> Well this is "ouch" situation.. : ). Crontab is fine, other stuff
> there is working OK.. Weird
>
> On Mon, Oct 31, 2011 at 12:10 AM, Colin Percival <cperciva@tarsnap.com> wrote:
> > Try
> > # tarsnap --list-archives -vv
> >
> > That will show what command line was used to create each archive.
> >
> >> now there is 'mybackup' while it should be backup-%date right?
> >
> > If I'm reading your cron line correctly, yes.
> >
> >> tarsnap -tv -f mybackup |grep '/var'
> >
> > As Max pointed out, this should be "grep 'var'" since the leading /
> > is removed.

--
Tim Bishop
http://www.bishnet.net/tim/
PGP Key: 0x5AE7D984