Sridhar Sarnobat
2022-Oct-17 05:59 UTC
Fwd: [3.1.3] --remove-source-files $SRC/ $SRC/ - erases all files
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 | ss533 at cornell.edu SMS me via email: 6073395366 at txt.att.net Google Chat: sarnobat.hotmail at gmail.com http://www.facebook.com/sridhar.sarnobat http://www.linkedin.com/in/sarnobat http://github.com/sarnobat -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.samba.org/pipermail/rsync/attachments/20221016/3551364e/attachment.htm>
Roland
2022-Oct-17 08:46 UTC
Fwd: [3.1.3] --remove-source-files $SRC/ $SRC/ - erases all files
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 | ss533 at cornell.edu > SMS me via email: 6073395366 at txt.att.net > Google Chat: sarnobat.hotmail at gmail.com > http://www.facebook.com/sridhar.sarnobat > http://www.linkedin.com/in/sarnobat <http://www.linkedin.com/in/sarnobat> > http://github.com/sarnobat > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.samba.org/pipermail/rsync/attachments/20221017/31af09b7/attachment.htm>
Wayne Davison
2022-Oct-19 15:39 UTC
[3.1.3] --remove-source-files $SRC/ $SRC/ - erases all files
On Sun, Oct 16, 2022 at 11:01 PM Sridhar Sarnobat wrote:> 90% of my data losses are caused by rsync'ing from dir A to dir A >Upgrade to 3.2.6 (or 3.2.7pre1): https://download.samba.org/pub/rsync/NEWS#3.2.6 ..wayne.. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.samba.org/pipermail/rsync/attachments/20221019/28914142/attachment.htm>