Re: Fwd: [3.1.3] --remove-source-files $SRC/ $SRC/ - erases all files

2022-10-17 Thread Sridhar Sarnobat via rsync
>
> 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?
-- 
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html


Re: Fwd: [3.1.3] --remove-source-files $SRC/ $SRC/ - erases all files

2022-10-17 Thread Kevin Korb via rsync
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.   ke...@futurequest.net  (work)
Orlando, Floridak...@sanitarium.net (personal)
Web page:   https://sanitarium.net/
PGP public key available on web site.
~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,

--
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html


Re: Fwd: [3.1.3] --remove-source-files $SRC/ $SRC/ - erases all files

2022-10-17 Thread Sridhar Sarnobat via rsync
>> 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?
-- 
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html


Re: Fwd: [3.1.3] --remove-source-files $SRC/ $SRC/ - erases all files

2022-10-17 Thread Roland via rsync

why not avoid using "--remove-source-files" and delete files
manually/via extra step afterwards ?

Am 17.10.22 um 08:59 schrieb Sridhar Sarnobat via rsync:

90% of my data losses are caused by rsync'ing from dir A to dir A
(accidental incorrect copy and paste, or where dir B is a symlink to
dir A). The source gets erased unintentionally.

It may seem dumb but when you get really long commands and really long
file paths it will happen a 1-2 times a yearwhen I'm doing it
dozens/hundreds of times every week.

*Is there an existing mechanism to protect against this?* rsync should
logically never erase all copies of data.

I know I can backup files (which I do for my smaller drives), or
create wrapper scripts but I'm not asking about those.I don't think
adopting --dry-run is practical being such a heavy user (and moreover,
it's unlikely to warn what will happen).

I'm not a C developer so I probably can't do this myself but if
anyone's encouraging me to then I'd give it a shot.


Sridhar Sarnobat
San Jose, CA 95128 | USA
Phone: +1 (650) 260-3851 | ss...@cornell.edu
SMS me via email: 6073395...@txt.att.net
Google Chat: sarnobat.hotm...@gmail.com
http://www.facebook.com/sridhar.sarnobat
http://www.linkedin.com/in/sarnobat 
http://github.com/sarnobat


-- 
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html


Fwd: [3.1.3] --remove-source-files $SRC/ $SRC/ - erases all files

2022-10-17 Thread Sridhar Sarnobat via rsync
90% of my data losses are caused by rsync'ing from dir A to dir A
(accidental incorrect copy and paste, or where dir B is a symlink to dir
A). The source gets erased unintentionally.

It may seem dumb but when you get really long commands and really long file
paths it will happen a 1-2 times a year when I'm doing it dozens/hundreds
of times every week.

*Is there an existing mechanism to protect against this?* rsync should
logically never erase all copies of data.

I know I can backup files (which I do for my smaller drives), or create
wrapper scripts but I'm not asking about those. I don't think adopting
--dry-run is practical being such a heavy user (and moreover, it's unlikely
to warn what will happen).

I'm not a C developer so I probably can't do this myself but if anyone's
encouraging me to then I'd give it a shot.


Sridhar Sarnobat
San Jose, CA 95128 | USA
Phone: +1 (650) 260-3851 | ss...@cornell.edu
SMS me via email: 6073395...@txt.att.net
Google Chat: sarnobat.hotm...@gmail.com
http://www.facebook.com/sridhar.sarnobat
http://www.linkedin.com/in/sarnobat
http://github.com/sarnobat
-- 
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html