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

Matt McCutchen matt at mattmccutchen.net
Sat Dec 13 07:24:16 GMT 2008


On Mon, 2008-12-08 at 17:23 -0500, Josh Hanson wrote:
> 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.)

--backup-dir gives you essentially this, except that you would always
specify the same destination, and rsync would move the changed files out
of that directory each time instead of moving the unchanged files over
to a new directory.

-- 
Matt



More information about the rsync mailing list