Not removing source files when using --remove-source-files

2022-12-23 Thread Rob Campbell via rsync
I have rsync -rvz --prune-empty-dirs --remove-source-files --log-file="rsync.log" --backup -e 'ssh' -f'- Saved/*' -f'- Screenshots/*' -f'- Boondocks/*' -f'- Dilbert/*' -f'+ */' -f'+ /*' -f'+ *.jp*g' -f'+ *.png' -f'+ *.nef' -f'+ *.gif' -f'- *' linuxuser@10.0.0.11:/home/linuxuser/Pictur

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

2022-10-19 Thread Sridhar Sarnobat via rsync
> Upgrade to 3.2.6 (or 3.2.7pre1): https://download.samba.org/pub/rsync/NEWS#3.2.6 Thank you very much Wayne. And thank you personally to whoever made the code modifications (I wish I could find the pull request!). I can't explain how important this is to me. The new binary file is worth its

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

2022-10-19 Thread Wayne Davison via rsync
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.. -- Please use reply-all for most replies to avoid omitting the mailing list.

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

2022-10-18 Thread Kevin Korb via rsync
Rsync does not have a --no-clobber. -n is --dry-run. It shows what rsync would do without actually doing it. But I didn't know you were using --backup. Anyway, I tried it again with --backup and --remove-source-files and it did in fact delete all the files (but not the dirs). It didn't

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. > Thank

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

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 extr

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 syml

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

[Bug 14394] Add an option for --remove-source-files to remove files right away

2020-06-07 Thread just subscribed for rsync-qa from bugzilla via rsync
https://bugzilla.samba.org/show_bug.cgi?id=14394 Wayne Davison changed: What|Removed |Added Resolution|--- |WONTFIX Status|NEW

[Bug 14394] New: Add an option for --remove-source-files to remove files right away

2020-05-26 Thread just subscribed for rsync-qa from bugzilla via rsync
https://bugzilla.samba.org/show_bug.cgi?id=14394 Bug ID: 14394 Summary: Add an option for --remove-source-files to remove files right away Product: rsync Version: 3.2.0 Hardware: All OS: All

copy-links with remove-source-files doesn't remove the source links

2020-01-06 Thread Andrew Hewus Fresh via rsync
for a small proof-of-concept, although I get the same results over ssh. $ rsync 2>&1 | head -1 rsync version 3.1.3 protocol version 31 $ mkdir src dst $ echo content > file $ ln -s ../file src/link $ rsync -a --copy-links --remove-source-files src/ dst/ ERROR: Skipping sender remove f

[Bug 10494] remove-source-files fails with symlinks

2019-03-20 Thread just subscribed for rsync-qa from bugzilla via rsync
https://bugzilla.samba.org/show_bug.cgi?id=10494 --- Comment #5 from Adrian Torregrosa --- I embedded the modified sender.c into 3.1.3's original source code, compiled and tested, and I found it to have solved the problem: first I tried uploading a softlink and deleting, then I tried uploading a

[Bug 10494] remove-source-files fails with symlinks

2019-03-16 Thread just subscribed for rsync-qa from bugzilla via rsync
https://bugzilla.samba.org/show_bug.cgi?id=10494 --- Comment #4 from Wayne Davison --- In my prior testing I apparently missed that the symlink verification issue was caused by -L (--copy-links). I have amended the change to use do_stat() when --copy-links is enabled. -- You are receiving

[Bug 10494] remove-source-files fails with symlinks

2019-03-14 Thread just subscribed for rsync-qa from bugzilla via rsync
https://bugzilla.samba.org/show_bug.cgi?id=10494 --- Comment #3 from Adrian Torregrosa --- Another option that I tried and verified, and that could make more sense, would be to replace 141 if (do_lstat(fname, ) < 0) { with 141 if (do_stat(fname, ) < 0) { -- You are receiving

[Bug 10494] remove-source-files fails with symlinks

2019-03-14 Thread just subscribed for rsync-qa from bugzilla via rsync
https://bugzilla.samba.org/show_bug.cgi?id=10494 --- Comment #2 from Adrian Torregrosa --- We have found this same problem using rsync 3.1.2. I have downloaded the source code for version 3.1.3, and found the following lines in sender.c: 146 if (S_ISREG(file->mode) /* Symlinks &

[Bug 10494] remove-source-files fails with symlinks

2015-07-12 Thread samba-bugs
https://bugzilla.samba.org/show_bug.cgi?id=10494 Wayne Davison way...@samba.org changed: What|Removed |Added Status|NEW |RESOLVED

[Bug 6307] rsync --remove-source-files foo/ foo/ should not delete files

2015-06-28 Thread samba-bugs
https://bugzilla.samba.org/show_bug.cgi?id=6307 --- Comment #2 from tombosho...@gmail.com tombosho...@gmail.com --- Same for me. No data loss here, but a bunch of work undeleting the files and moving them back to the right directories. Files should only be removed if they are actually copied to

Flush delete command on rsync exit with --remove-source-files

2014-05-28 Thread Christopher Pezley
When the option --remove-source-files is specified, files are not immediately deleted on the remote machine after being transfered. Instead, it is (as far as I understand) queued up in the list of actions. If rsync is ended with SIGTERM or SIGINT, then a transfered file may not be deleted

[Bug 10494] New: remove-source-files fails with symlinks

2014-03-10 Thread samba-bugs
https://bugzilla.samba.org/show_bug.cgi?id=10494 Summary: remove-source-files fails with symlinks Product: rsync Version: 3.1.0 Platform: x64 OS/Version: Linux Status: NEW Severity: major Priority: P5

--remove-source-files problem when used with --write-batch

2013-11-21 Thread Ted Toal
I used this rsync command: rsync -az --only-write-batch=tmp.rsync --inplace --remove-source-files --include='*' --include='*/' tmp/ nonexistent_dir which created file tmp.rsync.sh containing this rsync command: rsync --filter=._- -az --read-batch=tmp.rsync --inplace --remove

[Bug 3845] Make --remove-source-files remove directories too

2012-05-07 Thread samba-bugs
https://bugzilla.samba.org/show_bug.cgi?id=3845 --- Comment #7 from Tammer Ibrahim tamme...@gmail.com 2012-05-07 12:56:59 UTC --- Hello, I'm also quite interested in this feature. Rsync is already the perfect augmentation of the cp command, and adding this feature would similarly allow an easy

[Bug 7691] rsync remove-source-files and opened file

2011-06-18 Thread samba-bugs
the user not shoot themselves in the foot. I have made rsync re-stat the file and skip the remove if the size or mtime is different. This will be fixed in 3.1.0. I've also added some helpful hints in the manpage on how best to use --remove-source-files. -- Configure bugmail: https

[Bug 8076] New: Rsync --remove-source-files Rule Filters Enhancement

2011-04-11 Thread samba-bugs
https://bugzilla.samba.org/show_bug.cgi?id=8076 Summary: Rsync --remove-source-files Rule Filters Enhancement Product: rsync Version: 3.1.0 Platform: All OS/Version: All Status: NEW Severity: enhancement Priority

DO NOT REPLY [Bug 7691] New: rsync remove-source-files and opened file

2010-09-21 Thread samba-bugs
https://bugzilla.samba.org/show_bug.cgi?id=7691 Summary: rsync remove-source-files and opened file Product: rsync Version: 3.0.6 Platform: All OS/Version: Linux Status: NEW Severity: normal Priority: P3

on remote machine: --remove-source-files: unknown option

2010-04-22 Thread N. Yaakov Ziskind
I'm trying to sync from 3.0.5 to 2.5.5 (SCO, *sigh*) The source machine errors out b/c the --remove-source-files (or --remove-sent-files) options don't exist on 2.5.5. But, since these option are only acted on by the sending machine (which is where I'm typing the command line), it would be so

Re: on remote machine: --remove-source-files: unknown option

2010-04-22 Thread Matt McCutchen
On Thu, 2010-04-22 at 12:53 -0400, N. Yaakov Ziskind wrote: I'm trying to sync from 3.0.5 to 2.5.5 (SCO, *sigh*) The source machine errors out b/c the --remove-source-files (or --remove-sent-files) options don't exist on 2.5.5. But, since these option are only acted on by the sending

DO NOT REPLY [Bug 6307] rsync --remove-source-files foo/ foo/ should not delete files

2010-02-20 Thread samba-bugs
https://bugzilla.samba.org/show_bug.cgi?id=6307 cool...@gmail.com changed: What|Removed |Added CC||cool...@gmail.com --- Comment

DO NOT REPLY [Bug 3845] Make --remove-source-files remove directories too

2009-10-18 Thread samba-bugs
https://bugzilla.samba.org/show_bug.cgi?id=3845 l...@kraav.com changed: What|Removed |Added CC||l...@kraav.com --- Comment #6 from

Re: Delay for --remove-source-files

2009-10-15 Thread Matt McCutchen
On Tue, 2009-10-13 at 03:51 -0700, Martin Scharrer wrote: I'm using rsync with -aP --remove-source-files to move files from one machine to another while watching the progress. I'm under the impression that rsync is deleting the transmitted source files on-the-fly, not at the very end

Re: Delay for --remove-source-files

2009-10-15 Thread Martin Scharrer
Matt McCutchen-7 wrote: On Tue, 2009-10-13 at 03:51 -0700, Martin Scharrer wrote: I'm using rsync with -aP --remove-source-files to move files from one machine to another while watching the progress. I'm under the impression that rsync is deleting the transmitted source files on-the-fly

Delay for --remove-source-files

2009-10-13 Thread Martin Scharrer
Hi, I'm using rsync with -aP --remove-source-files to move files from one machine to another while watching the progress. I'm under the impression that rsync is deleting the transmitted source files on-the-fly, not at the very end, but with a delay of 2-3 files, i.e. if 10 files are moved

Re: --remove-source-files

2009-06-04 Thread Wayne Davison
On Tue, Jun 02, 2009 at 04:08:26PM +, C?sar Tejeda Hern?ndez wrote: rsync -tai --remove-source-files --ignore-existing --no-g --no-o --no-p u...@source:operativo/almacen/{ESP05/recorte/*.tar,EU/recorte/*.tar} /media/BACKUP3_PROMES10/PROMES10km/ [...] ¿Is there any way to specify

remove-source-files checking for open files?

2009-06-03 Thread Roy Sigurd Karlsbakk
hi We have a box here connected to an antenna receiving rather large amounts of metheorological data from a satellite. the data is received and ransferred to another box and removed from the receiving server. I first thought of using rsync for this, but it seems --remove-source- files has

Re: remove-source-files checking for open files?

2009-06-03 Thread Paul Slootman
for this, but it seems --remove-source- files has no way of checking if the file is open or not, so if the receiving process is still writing to a file, rsync will transfer the file and unlink() it without bothering if the file has been modified any further, effectively resulting

Re: remove-source-files checking for open files?

2009-06-03 Thread Roy Sigurd Karlsbakk
the receiving server. I first thought of using rsync for this, but it seems --remove-source- files has no way of checking if the file is open or not, so if the receiving process is still writing to a file, rsync will transfer the file and unlink() it without bothering if the file has been modified any

Re: remove-source-files checking for open files?

2009-06-03 Thread Paul Slootman
On Wed 03 Jun 2009, Roy Sigurd Karlsbakk wrote: I would solve this not using rsync, but by writing the active file in a separate directory, or by first writing to a special filename and renaming when done (like firefox adds .part to the filename while it is still downloading it). Why not

Re: remove-source-files checking for open files?

2009-06-03 Thread Roy Sigurd Karlsbakk
On 3. juni. 2009, at 18.16, Paul Slootman wrote: On Wed 03 Jun 2009, Roy Sigurd Karlsbakk wrote: I would solve this not using rsync, but by writing the active file in a separate directory, or by first writing to a special filename and renaming when done (like firefox adds .part to the

Re: remove-source-files checking for open files?

2009-06-03 Thread Paul Slootman
On Wed 03 Jun 2009, Roy Sigurd Karlsbakk wrote: On 3. juni. 2009, at 18.16, Paul Slootman wrote: Because checking whether a process has a file open can be very costly in system resources. Not really. I'm writing some code doing this now. It will be Linux Well, it's not something to do

Re: remove-source-files checking for open files?

2009-06-03 Thread Roy Sigurd Karlsbakk
On 3. juni. 2009, at 19.31, Paul Slootman wrote: On Wed 03 Jun 2009, Roy Sigurd Karlsbakk wrote: On 3. juni. 2009, at 18.16, Paul Slootman wrote: Because checking whether a process has a file open can be very costly in system resources. Not really. I'm writing some code doing this now.

--remove-source-files

2009-06-02 Thread César Tejeda Hernández
Hello all, I am using rsync version 3.0.3 protocol version 30, and I was wondering if I could use --remove-source-files option in this fashion: I use a crontab to dayly backup data, something like: rsync -tai --remove-source-files --ignore-existing --no-g --no-o --no-p u

DO NOT REPLY [Bug 6307] New: --remove-source-files removes files if source and destination are the same

2009-04-30 Thread samba-bugs
https://bugzilla.samba.org/show_bug.cgi?id=6307 Summary: --remove-source-files removes files if source and destination are the same Product: rsync Version: 3.0.5 Platform: x86 OS/Version: Linux Status: NEW

Exclude some source files from being deleted when --remove-source-files is used

2009-01-28 Thread Martin Scharrer
Hi, I'm using rsync to transfer some files from host A to B and using --remove-source-files to remove them from A after the transfer. Now however I have one file 'md5sum' which should be transfered but not removed. I tried the protect filter rule but this seems not to work in this case. All

Re: Exclude some source files from being deleted when --remove-source-files is used

2009-01-28 Thread Matt McCutchen
On Wed, 2009-01-28 at 01:58 -0800, Martin Scharrer wrote: I'm using rsync to transfer some files from host A to B and using --remove-source-files to remove them from A after the transfer. Now however I have one file 'md5sum' which should be transfered but not removed. I tried the protect

Re: rsync hangs during --remove-source-files

2008-10-19 Thread Thomas Gutzler
Wayne Davison wrote: On Fri, Oct 17, 2008 at 03:34:03PM +0800, Thomas Gutzler wrote: I had another rsync hang. I've attached a text file with the stack traces you asked for and some other info. [...] So, the strange thing is that the receiver is waiting around for more files to process,

Re: rsync hangs during --remove-source-files

2008-10-18 Thread Wayne Davison
On Fri, Oct 17, 2008 at 03:34:03PM +0800, Thomas Gutzler wrote: I had another rsync hang. I've attached a text file with the stack traces you asked for and some other info. The generator backtrace shows that it is waiting for the receiver to finish some files before going on. This attempts to

Re: rsync hangs during --remove-source-files

2008-10-17 Thread Thomas Gutzler
, 2008-10-13 at 21:19 +0800, Thomas Gutzler wrote: I'm using the following command to move files from a to b: rsync -a --remove-source-files --ignore-existing /path/to/dir1/ /path/to/dir2 logfile dir2 isn't empty so I only move files from dir1 to dir2 that don't exist already. Every so often

rsync hangs during --remove-source-files

2008-10-13 Thread Thomas Gutzler
Hi, I'm using the following command to move files from a to b: rsync -a --remove-source-files --ignore-existing /path/to/dir1/ /path/to/dir2 logfile dir2 isn't empty so I only move files from dir1 to dir2 that don't exist already. Every so often rsync stops in the middle and doesn't continue

Re: rsync hangs during --remove-source-files

2008-10-13 Thread Matt McCutchen
On Mon, 2008-10-13 at 21:19 +0800, Thomas Gutzler wrote: I'm using the following command to move files from a to b: rsync -a --remove-source-files --ignore-existing /path/to/dir1/ /path/to/dir2 logfile dir2 isn't empty so I only move files from dir1 to dir2 that don't exist already

DO NOT REPLY [Bug 5327] New: rsync hangs when using --remove-source-files with a bunch of files

2008-03-16 Thread samba-bugs
https://bugzilla.samba.org/show_bug.cgi?id=5327 Summary: rsync hangs when using --remove-source-files with a bunch of files Product: rsync Version: 3.0.0 Platform: Other OS/Version: Linux Status: NEW

DO NOT REPLY [Bug 5327] rsync hangs when using --remove-source-files with a bunch of files

2008-03-16 Thread samba-bugs
https://bugzilla.samba.org/show_bug.cgi?id=5327 --- Comment #1 from [EMAIL PROTECTED] 2008-03-16 09:00 CST --- Created an attachment (id=3175) -- (https://bugzilla.samba.org/attachment.cgi?id=3175action=view) Fix a hang when using --remove-source-files and --dry-run This patch

DO NOT REPLY [Bug 5327] rsync hangs when using --remove-source-files with a bunch of files

2008-03-16 Thread samba-bugs
https://bugzilla.samba.org/show_bug.cgi?id=5327 [EMAIL PROTECTED] changed: What|Removed |Added Status|NEW |RESOLVED Resolution|

DO NOT REPLY [Bug 3845] Make --remove-source-files remove directories too

2008-03-10 Thread samba-bugs
https://bugzilla.samba.org/show_bug.cgi?id=3845 [EMAIL PROTECTED] changed: What|Removed |Added CC||[EMAIL PROTECTED] --- Comment

Re: Using --remove-source-files with backup?

2007-05-09 Thread Matt McCutchen
On 5/7/07, ScottZ [EMAIL PROTECTED] wrote: With --source-backup the tree structure of the original source file is also being included in the --backup-dir directory. That is an idiosyncracy of the quick-and-dirty way I implemented the source backup, and I documented it in the patched man page.

Re: Using --remove-source-files with backup?

2007-05-06 Thread Matt McCutchen
option that backs up source files removed due to --remove-source-files. In my limited testing, it seems to work. -- Matt McCutchen [EMAIL PROTECTED] --- old/options.c +++ new/options.c @@ -30,6 +30,7 @@ extern struct filter_list_struct filter_ extern struct filter_list_struct server_filter_list

RE: Using --remove-source-files with backup?

2007-05-06 Thread ScottZ
in the --backup-dir directory. example: rsync --remove-source-files --source-backup --backup-dir=/arc -av /home/dir/file remotehost:/dir/file results in the backup file being put in /arc/home/dir/file instead of /arc/file. It isn't a problem for me as my tree structure is limited to just a couple

RE: Using --remove-source-files with backup?

2007-05-05 Thread ScottZ
Essentially you want to move each source file to another directory after it is successfully transferred. Exactly. I'm sure there's a way to accomplish this, but it might not be simple. I'll tell you if I find one. Thanks for looking at this Matt. -- To unsubscribe or change

Using --remove-source-files with backup?

2007-05-04 Thread ScottZ
I have a scenario where I am copying from a local system to remote target and need to remove the local source files once they have been successfully transfered. --remove-source-files works fine for this. An issue has come up in that I need to be able to backup the removed local source files

Re: Using --remove-source-files with backup?

2007-05-04 Thread Matt McCutchen
On 5/4/07, ScottZ [EMAIL PROTECTED] wrote: Is this a bug or is the backup option only able to backup deleted target files? The latter: --backup only backs up files deleted from the target. Is there another way around this? Essentially you want to move each source file to another directory

DO NOT REPLY [Bug 3845] Make --remove-source-files remove directories too

2007-02-21 Thread samba-bugs
https://bugzilla.samba.org/show_bug.cgi?id=3845 [EMAIL PROTECTED] changed: What|Removed |Added Summary|Add --remove-source-files |Make --remove-source-files

DO NOT REPLY [Bug 3845] Add --remove-source-files

2006-06-30 Thread samba-bugs
https://bugzilla.samba.org/show_bug.cgi?id=3845 --- Comment #3 from [EMAIL PROTECTED] 2006-06-30 11:03 MST --- Created an attachment (id=2010) -- (https://bugzilla.samba.org/attachment.cgi?id=2010action=view) Add --remove-source-files option Here is a patch that adds the --remove

DO NOT REPLY [Bug 3845] Add --remove-source-files

2006-06-27 Thread samba-bugs
, and rather gross, solution is to summarily delete everything in the transfer directory after rsync completes successfully. --jc (In reply to comment #0) Let's have a --remove-source-files option that works like --remove-sent-files but removes from the source everything in the file list, not just

DO NOT REPLY [Bug 3845] New: Add --remove-source-files

2006-06-16 Thread samba-bugs
https://bugzilla.samba.org/show_bug.cgi?id=3845 Summary: Add --remove-source-files Product: rsync Version: 2.6.9 Platform: All OS/Version: All Status: NEW Severity: enhancement Priority: P3 Component: core