Kevin Korb
2022-Oct-18 03:20 UTC
Fwd: [3.1.3] --remove-source-files $SRC/ $SRC/ - erases all files
I think I must be missing something. If source and dest are the same place rsync shouldn't do anything unless it it responding to changes happening at the same time. For example, when I do 'rsync -vain --remove-source-files /tmp/ /tmp/' rsync does nothing. On 10/17/22 23:12, Sridhar Sarnobat via rsync wrote:> >> why not avoid using "--remove-source-files" and delete files > manually/via extra step afterwards > > Multiple reasons. Among them: > 1) my jobs run a long time and there are a lot of them. Trying to > remember what I did over ssh (where history doesn't get saved) is an > extra cognitive load and the system is in a transient state (I've ended > up with duplicate files unless I do the extra work later - potentially > much later depending on the size of the job). I may also have multiple > rsync commands running in separate terminals. > 2) I am managing a lot of large files, and my collection of disks > doesn't have 2x free space. > 3) 2 operations instead of 1 gives more room to make a mistake. > > This is a workaround that I can occasionally use, and you could even say > "why not just use ext4magic?" to recover accidentally deleted files etc. > > Regardless, the semantics of deleting source files without leaving one > copy of your files intact should never happen right? > >-- ~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._., Kevin Korb Phone: (407) 252-6853 Systems Administrator Internet: FutureQuest, Inc. Kevin at FutureQuest.net (work) Orlando, Florida kmk at sanitarium.net (personal) Web page: https://sanitarium.net/ PGP public key available on web site. ~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,
Sridhar Sarnobat
2022-Oct-18 03:51 UTC
Fwd: [3.1.3] --remove-source-files $SRC/ $SRC/ - erases all files
> > I think I must be missing something. If source and dest are the same > place rsync shouldn't do anything unless it it responding to changes > happening at the same time. For example, when I do 'rsync -vain > --remove-source-files /tmp/ /tmp/' rsync does nothing. >Thanks for the response. You are using "-n" / "--no-clobber". In my case I'm using "-b" / "--backup" (or overwrite). My use case is to get everything out of the source location, and "--no-clobber" will leave things behind. So I guess I should refine my issue to "when you're not using --no-clobber." Do I have a case here? Or is this erasing both the source and destination a valid behaviour in my case? -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.samba.org/pipermail/rsync/attachments/20221017/6ef3a3a3/attachment.htm>