RE: xfsdump/xfsrestore question

Leon Kolchinsky
2007-02-26T13:14:48Z

> On Sat, Feb 24, 2007 at 05:04:33PM +0200, Leon Kolchinsky wrote:
> > Now, when I've tried to make non-interactive xfsdump I'vo got > prompt
> with
> > no action, like this
> > # xfsdump -f /data/backup2.file -L 'session1' -M 'media1" /
> > >
> > #
> >
> > So, I've got to Ctrl+C the process.
> >
> > Questions:
> > 1) What could be the syntax problem in the above command?
> > 2) Any examples for incremental xfsdump (non-interactive, i.e. run from
> > cronjob) would be very welcome (and also comments about xfsrestore from
> > these backups).
>
> My non-interactive backup is (fragment from a script):
>
> xfsdump -e -l $level -L "dump $lv at $day" - /$lv | gzip -v9 > $dest_file
>
> and it works without prompts. Combining this with LVM snapshots also
> makes consistent backups.
>

Thanks Iustin. It's very usefull.

So for non-interactive dumps I can use something like:
# xfsdump -e -l 0 -L "dump hda1 of `uname -n` at `date +%F`" -M "file" -f
/data/backup0.file /
# xfsdump -e -l 1 -L "dump hda1 of `uname -n` at `date +%F`" -M "file" -f
/data/backup1.file /
# xfsdump -e -l 2 -L "dump hda1 of `uname -n` at `date +%F`" -M "file" -f
/data/backup2.file /
etc.

The above is clear :)

The question now is how to maintain these dumps accordingly to
the inventory database in /var/lib/xfsdump/inventory.
I believe that if I just delete dump file, the inventory database won't be
updated, right?

Lets say, I did level 0 dump on Sunday and a 1,2,3,4,5,6 level backups on
the following days (all with different filenames o fcourse). So at the end
of the week I end up with 7 dump files.

I want this automatic procedure to continue to the next week with the same
filenames, so no additional files would be added and no disk space would be
wasted.

I came up with this:
--------------------
To remove the dump session in the inventory which is identified by the mount
point, was created prior to the specified date, and media_lable
Syntax:
xfsinvutil -n -m media_label -M mount_point mm/dd/yyyy

# DATE=`date +%m/%d/%Y`; xfsinvutil -n -m file0 -M vod:/ $DATE
# rm /data/backup0.file

I'll run the above 2 commands prior to xfsdump cronjobs. :)

This is my solution. If you have any comments/suggestion you are very
welcome.

Best Regards,
Leon Kolchinsky