In <20160602082722.8F11829233B7@macserver.private>, on 06/02/16 at 10:27 AM, Fabian Cenedese <cened...@indel.ch> said:
Hi Fabian, >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. Steven -- ---------------------------------------------------------------------- "Steven Levine" <stev...@earthlink.net> Warp/DIY/BlueLion etc. www.scoug.com www.arcanoae.com www.warpcave.com ---------------------------------------------------------------------- -- 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