I am having a problem using the backup_dir option of rsync. The command being used is basically rsync --archive --delete --backup --backup_dir=PathToBackup/save user@fromsystem:FilePath/ PathToBackup/ The feature that is unique to this problem is that the "save" directory is under the path where the files are being backed up. Fortunately, rsync is clever enough to not delete the PathToBackup/save tree even though there is no corresponding "save" tree on the "from" side. Now here is the problem. On the first run with modified files, the old versions are saved in PathToBackup/save. However, on the second run, those files are moved to PathToBackup/save/save and the "new" old versions are placed in PathToBackup/save. Each subsequent run produces another layer of the "save" tree. This is not the behavior i am hoping for. I would just like a single matching directory tree with the most recent old-version of each backed-up file that has been modified. So is this a bug? Am I doing something wrong? Does this behavior make sense somehow? Thanks for any help or suggestions. Steve
On Sat, Oct 20, 2001 at 08:30:58PM -1000, Steve Marx wrote:> I am having a problem using the backup_dir option > of rsync. The command being used is basically > > rsync --archive --delete --backup > --backup_dir=PathToBackup/save > user@fromsystem:FilePath/ PathToBackup/> being backed up. Fortunately, rsync is clever enough > to not delete the PathToBackup/save tree even though > there is no corresponding "save" tree on the "from" side.No it's not! It is deleteing it, just when it deletes it, it moves it to the "save" directory... You probably want to add -exclude save onto the command line to get what you want. Scott
Reasonably Related Threads
- Bug? backup_dir sometimes reported on STDOUT, sometimes not.
- [Bug 11812] New: rsync without --verbose still writes "(new) backup_dir is ..." to STDOUT
- Ensuring that rsync doesn't try to write to an unmounted drive
- Lookup another node's hiera data - fqdn hierarchy
- Ensuring that rsync doesn't try to write to an unmounted drive