[prev in list] [next in list] [prev in thread] [next in thread] 

List:       debian-user
Subject:    Re: rsync --delete
From:       "D. R. Evans" <doc.evans () gmail ! com>
Date:       2020-10-16 23:00:11
Message-ID: 9882306c-879e-1170-883d-213f9248b2ff () gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/mixed)]


Mike McClain wrote on 10/16/20 4:09 PM:
> I've been using rsync to backup to a flash drive but it's not
> performing exactly as I expected.
> 
> The man page says:
>     --delete                delete extraneous files from dest dirs
> A section of the backup script is so:
> Params=(-a --inplace --delete);
> Flash=/sda/rpi4b
> cd /home/mike
> [ ! -d $Flash/mike ] && mkdir $Flash/mike;
> 
> #   exclude compressed files and the contents of most of the .* directories
> /mc/bin/mk_rsync_exclude.sh
> echo /usr/bin/rsync $Params --exclude-from=/home/mike/.rsync_exclude . $Flash/mike
> /usr/bin/rsync $Params --exclude-from=/home/mike/.rsync_exclude . $Flash/mike ||
>     echo rsync $Params --exclude-from=/home/mike/.rsync_exclude . $Flash/mike    Failed $? ;
> 
>     If I delete a file from my home directory then backup over last
> week's copy the deleted file stays in the backup directory and these
> build up over time.
>     Am I misusing rsync or am I just not understanding how it works?

The latter :-)

You need to add:
  --delete-excluded

(I'll let you read the man page to see what that does :-) )

  Doc

-- 
Web:  http://enginehousebooks.com/drevans


["signature.asc" (application/pgp-signature)]

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic