<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p>I'm generating a list of files to sync, and would like all the
      files not in my list to be deleted from the destination. I thought
      that --delete-missing-args would do just that, but it doesn't
      delete anything.</p>
    <p>Would someone have an idea of what I'm doing wrong?</p>
    <p>This is what I tried :<br>
    </p>
    <p><tt>~$ mkdir -p /tmp/source /tmp/dest</tt><tt><br>
      </tt><tt><br>
      </tt><tt>~$ for i in {1..3}; do echo "keep $i"      >
        /tmp/source/keep$i; done</tt><tt><br>
      </tt><tt><br>
      </tt><tt>~$ for i in {4..5}; do echo "to remove $i" >
        /tmp/source/to-delete-$i; done</tt><tt><br>
      </tt><tt><br>
      </tt><tt>~$ rsync -va /tmp/source/ /tmp/dest/</tt><tt><br>
      </tt><tt>sending incremental file list</tt><tt><br>
      </tt><tt>./</tt><tt><br>
      </tt><tt>keep1</tt><tt><br>
      </tt><tt>keep2</tt><tt><br>
      </tt><tt>keep3</tt><tt><br>
      </tt><tt>to-delete-4</tt><tt><br>
      </tt><tt>to-delete-5</tt><tt><br>
      </tt><tt><br>
      </tt><tt>sent 410 bytes  received 114 bytes  1,048.00 bytes/sec</tt><tt><br>
      </tt><tt>total size is 45  speedup is 0.09</tt><tt><br>
      </tt><tt><br>
      </tt><tt>~$ for i in {1..3}; do touch /tmp/source/keep$i; done</tt><tt><br>
      </tt><tt><br>
      </tt><tt>~$ cd /tmp/source/</tt><tt><br>
      </tt><tt><br>
      </tt><tt>/tmp/source$ find . -name "keep*" | tee
        /tmp/source/file-list</tt><tt><br>
      </tt><tt>./keep2</tt><tt><br>
      </tt><tt>./keep1</tt><tt><br>
      </tt><tt>./keep3</tt><tt><br>
      </tt><br>
    </p>
    <p>Now, using my file-list which does not include the "to-delete*"
      files, I hoped that these would be deleted. The new files were
      correctly copied, but nothing was deleted:<tt><br>
      </tt></p>
    <p><tt>/tmp/source$ rsync -vva --delete --delete-missing-args
        --force --files-from=/tmp/source/file-list . /tmp/dest/</tt><tt><br>
      </tt><tt>building file list ... done</tt><tt><br>
      </tt><tt>delta-transmission disabled for local transfer or
        --whole-file</tt><tt><br>
      </tt><tt>./</tt><tt><br>
      </tt><tt>keep1</tt><tt><br>
      </tt><tt>keep2</tt><tt><br>
      </tt><tt>keep3</tt><tt><br>
      </tt><tt>total: matches=0  hash_hits=0  false_alarms=0 data=21</tt><tt><br>
      </tt><tt><br>
      </tt><tt>sent 259 bytes  received 143 bytes  804.00 bytes/sec</tt><tt><br>
      </tt><tt>total size is 21  speedup is 0.05</tt><tt><br>
      </tt><tt><br>
      </tt><tt>/tmp/source$ ls -Al /tmp/dest/</tt><tt><br>
      </tt><tt>total 20</tt><tt><br>
      </tt><tt>-rw-rw-r-- 1 mi mi  7 Apr 22 23:43 keep1</tt><tt><br>
      </tt><tt>-rw-rw-r-- 1 mi mi  7 Apr 22 23:43 keep2</tt><tt><br>
      </tt><tt>-rw-rw-r-- 1 mi mi  7 Apr 22 23:43 keep3</tt><tt><br>
      </tt><tt>-rw-rw-r-- 1 mi mi 12 Apr 22 23:42 to-delete-4</tt><tt><br>
      </tt><tt>-rw-rw-r-- 1 mi mi 12 Apr 22 23:42 to-delete-5</tt><tt><br>
      </tt></p>
    <p><tt><br>
      </tt>The files not in my --files-from list are still at the
      destination.<br>
    </p>
    <p>Thanks for any help,</p>
    <p>MI</p>
    <p><br>
    </p>
    <p>PS: my version of rsync :</p>
    <p><tt>~$ rsync --version</tt><tt><br>
      </tt><tt>rsync  version 3.1.1  protocol version 31</tt><tt><br>
      </tt><tt>Copyright (C) 1996-2014 by Andrew Tridgell, Wayne
        Davison, and others.</tt><tt><br>
      </tt><tt>Web site: <a class="moz-txt-link-freetext" href="http://rsync.samba.org/">http://rsync.samba.org/</a></tt><tt><br>
      </tt><tt>Capabilities:</tt><tt><br>
      </tt><tt>    64-bit files, 64-bit inums, 64-bit timestamps, 64-bit
        long ints,</tt><tt><br>
      </tt><tt>    socketpairs, hardlinks, symlinks, IPv6, batchfiles,
        inplace,</tt><tt><br>
      </tt><tt>    append, ACLs, xattrs, iconv, symtimes, prealloc</tt><tt><br>
      </tt><tt><br>
      </tt></p>
  </body>
</html>