--delete-missing-args doesn't delete

Francis.Montagnac at inria.fr Francis.Montagnac at inria.fr
Thu Apr 25 11:26:33 UTC 2019


Hi.
On Tue, 23 Apr 2019 16:35:15 +0200 MI via rsync wrote:

> If someone has a good suggestion on how to rsync a list of files and 
> delete from the destination any file that is not listed in --files-from, 
> that would be welcome.

Assuming you are talking about files in a same source directory, you
can do:

   - generate a file (KEEP_FILE) with the list of files you want
   - call: rsync ... --include-from KEEP_FILE \
     	     --delete --delete-excluded \
     	     SOURCE_DIR/ DESTINATION_DIR

KEEP_FILE should have the format:

+ /keep1/***
+ /keep2/***
...
- *

leading / to match only at the first level

/*** to match any level of sub-directory (if keep1 ... are
directories)

-- 
Francis



More information about the rsync mailing list