Rsync backup issues using relative paths and LVM snapshots

Jamie Lokier jamie at
Fri Jul 16 06:15:48 MDT 2010

Alex Ferrara wrote:
> My problem is that if I mark a directory to have a snapshot created
> before rsync and use the -R (relative) option, the directory
> structure on the destination system will be the relative path of
> where I mounted the snapshot (/mnt/sync-snapshot in my case). If I
> don't use the -R option, and I am trying to back up a snapshot of
> the directory /var/spool/cyrus, how can I get rsync to create the
> /var/spool directories for me before the sync?
> The following works, but creates /mnt/sync-snapshot on the destination server
> root at percy:/# rsync -auRv /mnt/sync-snapshot ds9::kingston

mkdir -p /mnt/alt-snapshot/var/spool/cyrus
mount /mnt/sync-snapshot /mnt/alt-snapshot/var/spool/cyrus -t bind
rsync -auRv /mnt/alt-snapshot/./var/spool/cyrus ds9::kingston
umount /mnt/alt-snapshot/var/spool/cyrus

-- Jamie

More information about the rsync mailing list