AW: Sync files not folders non recursively

Fabian Cenedese Cenedese at
Wed Mar 4 14:28:24 GMT 2009

>I am now trying to find a solution to my problem for quite some time. I hope
>you can help. What I am trying to do is to simply sync files with a special
>suffix to a destination folder. So I dont want to transfer recursively but I
>want to delete files from the destination which are not in the source
>Closest I have gotten is using this command:
>/usr/bin/rsync -dnolptgvze --delete --delete-excluded --include='*.htm' --in
>clude='*.html' --exclude='*' /SOURCE/ /DESTINATION/
>BUT this deletes Files from folder /DESTINATION/A which are not present in
>the Source. I dont want this to happen. Also it syncs folders to DESTINATION
>but I only want to sync files not folders.
>/usr/bin/rsync -dnolptgvze --delete --delete-excluded --include='*.htm' --in
>clude='*.html' --exclude='*' /SOURCE/* /DESTINATION/
>This command does not delete Files from folder /DESTINATION/A but in this
>care --delete is not working - files which are not in the source anymore are
>not deleted from destination.

I think you should use /SOURCE /DESTINATION (no trailing slashes).

bye  Fabi

More information about the rsync mailing list