I'm currently using rsync to backup home directories using this: rsync -avx --delete --backup --backup-dir=/u1/home.bak /u0/home/ /u1/home >> ${log} I'm trying to move to snapshot backups using this: rsync -avx --delete --backup --backup-dir=/u1/home.bak --link-dest=../home.current /u0/home/ /u1/home_${datetime} >> ${log} This works except I no longer get deleted source files moved to backup-dir. Is there a way to get this behavior with the link-dest feature? Thank you, Steve
On Tue, 2007-11-20 at 14:24 -0500, Steve wrote:> I'm currently using rsync to backup home directories using this: > > rsync -avx --delete --backup --backup-dir=/u1/home.bak /u0/home/ > /u1/home >> ${log} > > I'm trying to move to snapshot backups using this: > > rsync -avx --delete --backup --backup-dir=/u1/home.bak > --link-dest=../home.current /u0/home/ /u1/home_${datetime} >> ${log} > > This works except I no longer get deleted source files moved to > backup-dir. Is there a way to get this behavior with the link-dest > feature?No, because rsync only backs up files from the destination and your destination is now a new, empty directory instead of the previous snapshot. You can already recover files from previous snapshots; are you sure you also want a backup dir? If so, the best way I can think of to achieve this is to fill /u1/home_${datetime} with hard links from /u1/home.current using "cp -al" and then run the rsync command without the --link-dest option. To ensure that rsync does not corrupt attributes as seen through old snapshots, I recommend that you use a copy of rsync with this patch: https://bugzilla.samba.org/attachment.cgi?id=2960&action=view and pass the --no-tweak-hlinked option. Matt
On Nov 20, 2007 2:56 PM, Matt McCutchen <matt@mattmccutchen.net> wrote:> No, because rsync only backs up files from the destination and your > destination is now a new, empty directory instead of the previous > snapshot.Yep, I understood why it was working this way, just thought I may be missing an option to tweak the behavior.> You can already recover files from previous snapshots; are you sure you > also want a backup dir? If so, the best way I can think of to achieve > this is to fill /u1/home_${datetime} with hard links > from /u1/home.current using "cp -al" and then run the rsync command > without the --link-dest option. To ensure that rsync does not corrupt > attributes as seen through old snapshots, I recommend that you use a > copy of rsync with this patch: > > https://bugzilla.samba.org/attachment.cgi?id=2960&action=view > > and pass the --no-tweak-hlinked option.I will look into this, thanks for your help! Steve