At 17:57 02.06.2016, Steven Levine wrote: >>rsync -a --delete empty_local_folder remote_folder_to_delete > >>to get rid of the contents. However the folder itself still remains. So >>after a while I'd have a lot of empty folders. > >This comes up on the list every now and then. > >Here's a snip from an archive message: > > Here is how you would write an "rsyncrm" script that can be invoked like > "rsyncrm -ni remote::volume/directory". Note that this reveals the > attributes of the current directory to the server. > > #!/bin/bash > victim="${@: -1:1}" > rsync -d --del --filter="R /$(basename -- "$victim")" --filter='- /*' \ > "${@:1:$#-1}" . "$(dirname -- "$victim")" > >This works because it deletes the unwanted directory from the parent >directory.
Took me some time to find out what it does but it actually seems to work, thanks a lot. Now let's see if this method can also be used to really prune empty dirs in the destination. Is there no page with rsync tips and tricks? Would be nice to have such cool commands collected in one place. bye Fabi -- 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