[Bug 8367] New: Add a feature to --move-existing files
samba-bugs at samba.org
samba-bugs at samba.org
Tue Aug 9 12:45:32 MDT 2011
https://bugzilla.samba.org/show_bug.cgi?id=8367
Summary: Add a feature to --move-existing files
Product: rsync
Version: 3.0.8
Platform: All
OS/Version: All
Status: NEW
Severity: enhancement
Priority: P5
Component: core
AssignedTo: wayned at samba.org
ReportedBy: devin.nate at cloudwerx.com
QAContact: rsync-qa at samba.org
Created attachment 6766
--> https://bugzilla.samba.org/attachment.cgi?id=6766
Patch file to add --move-existing
The use case is one where rsync is being used to replicate files from a source
to a destination, with the --remove-source-files flag being used. The files on
the source are created sequentially, based on the file existing or not.
Essentially, software creates a files named 1.tif, 2.tif, 3.tif, and so on,
based on the existance of the files. If rsync moves the files from the source
to the destination, then the files 1.tif, 2.tif, 3.tif, etc., no longer exist
on the source, so the software on the source re-starts it's numbering. Then,
when rsync is run again either: (a) it'll sync the files up, which essentially
means all prior data was lost, since they are totally different files, or (b)
if --ignore-existing is used, the files back up on the source (good in that
there's no data loss, bad that the files don't move).
The attached patch is a first attempt at adding a --move-existing functionality
to rsync. It does not honour --dry-run and probably a ton of other use cases.
It also uses strftime and some other functions which I see are in IFDEF blocks
in other areas. The new filename generator should probably be in util.c, and
it's logging is ugly right now. It's not well documented (aka no man page
entry).
It will rename a file in this format:
SOURCE: filename.ext
DEST POST RENAME: filename_2011-08-09-13-44-22-1.ext
It's somewhat contrary to rsync individual file sync, since it suggests we
specifically don't want to sync a particular file. That said, it is in line
with the concept of wanting to sync a (poorly) created series of files in a
safe manner.
Thanks,
Devin
--
Configure bugmail: https://bugzilla.samba.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
More information about the rsync
mailing list