« Return to Thread: Feature Request - recursive --delete with --files-from=

Feature Request - recursive --delete with --files-from=

by Andrew Boettcher :: Rate this Message:

Reply to Author | View in Thread

I am currently running into an annoying problem.  I have a list of files I get from an SQL query and pass to rsync to fetch for a local cache.  I need to delete the files that are not on the list.  Right now my command looks something like:
[SQL query] | sed 's/^/+ /;/$/a\+ \*/\n- \*' | rsync -avm --progress --delete-before --delete-excluded --recursive --include-from=- $SRC $DST

with the sed adding the lines "+ */" and "- *" on the end, and "+ " on the start of each line.  Since --files-from (which could take my file list without modification) does not work recursively, --delete doesnt work.  Even with the line I use above I still have a problem - rsync wants to recursively scan ALL directories on $DST, very inefficient.  It would be nice if it could simply ask for the files in the list, and delete anything in $DST recursively that did not fit.

Andrew Boettcher

--
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html

 « Return to Thread: Feature Request - recursive --delete with --files-from=

LightInTheBox - Buy quality products at wholesale price!