Rsync can only delete files out of directories it is told to examine, and
by specifying $1.* you're giving it a list of files inside the $first
directory and not the $first directory itself. That's why it can't
delete
anything out of $first. You should remove the "$1.*" (and *not* the
trailing slash) and instead use --include "/$1.*" and --exclude
"/*".
- Dave Dykstra
On Tue, Mar 19, 2002 at 08:54:44AM +0100, Freerk J. Bosscha
wrote:>
> Thanks for reading this question,
>
> First off all, i'm quit new working with rsync.
>
> What I want is to exactly mirror a directory from one
> system to another system including removing non existing
> files on the targen if they do not exist on the source.
>
> I though that adding the parameter --delete, would do the
> job, but nothing happens.
>
> The exact command I give is:
>
> /usr/local1/bin/rsync --compress --recursive --times --perms
> --delete /var/imap/user/$first/$1.* mailbackup:mbox/$first/
>
> What am I doing wrong,
>
> ----------------------
> Freerk J. Bosscha