rsync –delete –files-from=list / dest/ does not delete unwanted files

Perhaps you could do this using a list of include patterns instead, and use –delete-excluded (which does as the name suggests)? Something like: rsync -r –include-from=<patternlistfile> –exclude=* –delete-excluded / dest/ If filenames are likely to contain wildcard characters (*, ? and [) then you may need to modify the Python to escape them: re.sub(“([[*?])”, r”\\\1″, … Read more

rsync exclude a directory but include a subdirectory

Sometime it’s just a detail. Just change your include pattern adding a trailing / at the end of include pattern and it’ll work: rsync -avz –delete –include=specs/install/project1/ \ –exclude=specs/* /srv/http/projects/project/ \ [email protected]:~/projects/project Or, in alternative, prepare a filter file like this: $ cat << EOF >pattern.txt > + specs/install/project1/ > – specs/* > EOF Then … Read more

rsync incremental file list taking forever

The documentation for -v says increase verbosity. If the only thing you’re interested in is seeing more progress, you can chain -v together like so: rsync -avvvhr /sauce/folder/ [email protected]:/dest/folder/ and you should see more interesting progress. This could tell you if your copying requirements -a are stricter than you need and thus take a lot … Read more