Brian K. White wrote:

> ... Looks like it works, but only for files not directories.
> 
> All I did was change:
> rsync $OPTS --include=/$F --exclude='*' $P ${h}::root$P
> to
> rsync $OPTS --include=/$F --exclude='*' ${P}/. ${h}::root${P}/.
> 
> And now if the file doesn't exist locally it is deleted from the remote 
> host.

The include rule for a direftory is different (see manpage). Try

rsync -avx --include="/$F/*" --include="/$F" --exclude='*' --delete "$P" 
"${h}:root${P}/.

This covers cases where $F is a file or a directory with some files in there.

For deleting recursive directories, the section "INCLUDE/EXCLUDE PATTERN RULES"
will give you an idea.

Have fun,
Berny
-- 
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

Reply via email to