[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Using UFS snapshots with tarsnap
On 04/15/11 13:23, Hywel Mallett wrote:
> I'm a happy tarsnap user, across several FreeBSD systems. However I know
> I should really be backing up snapshots, particularly as I'm including
> PostgreSQL data directories in the backup.
> I'm familiar with snapshots, however, I've read the man page, seen the
> --snaptime option, Googled for examples, but I'm still confused as to
> the best was to do this.
> Does anyone have any examples of how they're backing up using snapshots
> on a UFS filesystem?
The point of the --snaptime option is to avoid the (very unlikely) situation
where a file modified a fraction of a second after a snapshot is created is
not recognized as being modified the next time a backup is created.
To create an archive from a snapshot of /usr:
# touch /tmp/snaptime
# mksnap_ffs /usr/.snap/mysnap
# mdconfig -a -t vnode -o ro -f /usr/.snap/mysnap -u 0
# mount -o ro /dev/md0 /mnt
# tarsnap --snaptime /tmp/snaptime -c -f '/usr' /mnt
# umount /mnt
# rm /usr/.snap/mysnap
# rm /tmp/snaptime
Basically, it works exactly the way you expect, with the only trick being that
you need to create the snaptime file before you create the snapshot (or you
could use --snaptime /path/to/something/in/the/snapshot which is obviously
going to be dated before the snapshot was created).
--
Colin Percival
Security Officer, FreeBSD | freebsd.org | The power to serve
Founder / author, Tarsnap | tarsnap.com | Online backups for the truly paranoid