On Sat, Nov 6, 2010 at 4:35 AM, Edvinas Valatka <[email protected]> wrote:

> rsync -a -vv -i -W --remove-source-files dir1/ dir2/
>

You'd need to also specify --ignore-non-existing to avoid adding any new
files into dir2.  Also, -W is assumed in a local transfer, and two -v opts
is probably overkill -- two -i opts would be better.

However, the ammended command would still update the matching filenames in
dir2 if they differ in dir1 (in size or mtime), which might not have been
the original intent.  If that is a problem, writing a shell script is
probably a better idea:

#!/bin/sh
cd /dir1
for file in *; do
    if -f "$file" && -f "/dir2/$file"; then
        rm "$file"
    fi
done

..wayne..
-- 
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