[CentOS] RSync Problem

Fri Feb 14 14:49:47 UTC 2014
Tony Mountifield <tony at softins.co.uk>

In article <52FE23C4.50101 at gmail.com>, Joseph Hesse <joehesse at gmail.com> wrote:
> I use an external USB drive and rsync to back up everything in /home.
> The USB drive has an entry in fstab and I mount it with "# mount /mnt"
> The rsync command I use is:
> 
> rsync -av --delete --include='.thunderbird' --include='.filezilla' 
> --include='.putty' \
> --exclude='.*' --exclude='Desktop' --exclude='VirtualBox*' /home/* 
> /mnt/home/
> 
> After I deleted one of the users on my system, including their home 
> directory, I ran the rsync command.
> I found that the deleted user's home directory wasn't deleted from 
> /mnt/home.
> I thought that the --delete option deleted everything on the destination 
> that was not on the source.

If you had specified /home/ instead of /home/* it would have done so.

If you originally had users fred, joe and mary on the system, your previous
rsyncs would have said ... /home/fred /home/joe /home/mary /mnt/home/

Then when you deleted joe, your rsync says ... /home/fred /home/mary /mnt/home/
so it doesn't even consider /home/joe on the target.

If you do change it, make sure you say /home/ and not /home

Hope this helps!
Tony

-- 
Tony Mountifield
Work: tony at softins.co.uk - http://www.softins.co.uk
Play: tony at mountifield.org - http://tony.mountifield.org