Feature I'd love to see: --move-dest

Josh Hanson JoshHanson at capriomgt.com
Mon Dec 8 22:23:38 GMT 2008


Looking over rsync's --compare-dest, --copy-dest, and --link-dest
options, there's one thing I really wish I could do, and I've been
looking for a few years now for a program that could do it: Instead of
copying or hard-linking from the compare directory to the target
directory, I'd like to move the files. 

That is, whenever the file already exists in the compare directory, it
is moved forward into the target directory; but if the existing file is
different or doesn't exist, then a new file is made in the target
directory. 

The result would be that, after several backups (each to a new
directory, perhaps named with the current date) the most recent
directory would be a snapshot of the source, and each previous directory
would have previous versions of files or copies of deleted files. (This
is effectively the opposite result of --compare-dest, which gives you a
snapshot of the first version of the files, with each successive
directory storing only the changed files.) This makes two very common
restore scenarios very simple: restoring the entire directory tree to
the most recent version after a drive failure, and restoring a previous
version of a single file after it was accidentally over-written, even if
the modified version has since been backed up.

I looked over the rsync source to see if I could add this functionality
myself, but I'm really not a very good programmer and it's definitely
beyond me. To someone familiar with the source, however, I have to
imagine it would be a fairly straightforward feature to add... just add
replace the copy operation in --copy-dest or the link operation in
--link-dest with a move operation.

-- Josh


More information about the rsync mailing list