--delete-during acts like --delete-before

Craig Bell Craig.Bell at standard.com
Wed Sep 8 17:07:03 MDT 2010

  Hello, I use rsync v3.0.7 with "--delete-during", but it appears to act more like "--delete-before".  I've checked the docs and list archives, but I am still discovering some of the subtleties of rsync, and I can't see where I'm going wrong.  There's an example of my issue below... can anybody set me straight?  =-)

  o We archive a small number of large files, each in its own directory.  Both storage and bandwidth are limited.
  o We keep only one edition of each file at any given time.  The filenames change with every revision.
  o We want to minimize the number of incomplete files at any point during the lengthy transfer.
  o Given more space, I would simply use "--delete-delay", or keep multiple file revisions.

  It looks like "--delete-during" should operate in-fix, i.e. step into a directory, delete the old file, pull the new file, and then move on to the next directory.   For my transfers, all deletes seem to take place up front.  The destination directory is emptied at the beginning of the session, which is what I want to avoid in case the link is severed, and the transfer is interrupted.

  Otherwise, rsync works as expected.  Both ends use v3.0.7 packages from sunfreeware.com.  The server config is pretty basic, and I see no errors on the source host.  Am I looking at this the right way, or am I missing something simple?  Let me know if you have any questions, and thanks in advance for any advice.  -cheers, CSB

  P.S.  My workaround is to run a separate rsync session for each subdirectory, followed by a final run from the top level.  That seems to work alright, but it's rather a kludge. -c


desthost $ ls -l */*                                              
-rw-r--r--   1 user    group    1048576 Sep  1 16:32 0/file-0
-rw-r--r--   1 user    group    1048576 Sep  1 16:32 1/file-1
-rw-r--r--   1 user    group    1048576 Sep  1 16:32 2/file-2
-rw-r--r--   1 user    group    1048576 Sep  1 16:32 3/file-3

desthost $ rsync -a --delete-during -i srchost::del-test .                           
*deleting   0/file-0
*deleting   1/file-1
*deleting   2/file-2
*deleting   3/file-3
.d..t...... 0/
>f+++++++++ 0/file-00
.d..t...... 1/
>f+++++++++ 1/file-11
.d..t...... 2/
>f+++++++++ 2/file-22
.d..t...... 3/
>f+++++++++ 3/file-33

desthost $ ls -l */*                                     
-rw-r--r--   1 user    group    1048576 Sep  1 16:32 0/file-00
-rw-r--r--   1 user    group    1048576 Sep  1 16:32 1/file-11
-rw-r--r--   1 user    group    1048576 Sep  1 16:32 2/file-22
-rw-r--r--   1 user    group    1048576 Sep  1 16:32 3/file-33


srchost $ cat /etc/rsyncd.conf

pid file = /var/run/rsyncd.pid
address = srchost
hosts allow = desthost
log file = /var/log/rsync.log
  comment = Try to delete files infix
  path = /var/tmp/del-test


More information about the rsync mailing list