rsync backup

Walter Dnes waltdnes-SLHPyeZ9y/tg9hUCZPvPmw at public.gmane.org
Wed Dec 8 07:41:30 UTC 2010


On Tue, Dec 07, 2010 at 03:02:40PM -0500, teddy mills wrote
> I rsync from /home/teddy/ to an external USB hard disk. It works fine.
> 
> rsync -avz --delete --exclude-from '/home/teddy/rsync-exclude' /home/teddy /media/backup
[...deletia...]
> I decided to put a trailing slash on /home/teddy/ and /media/backup/
> and run rsync again. rsync started deleting everything. (--delete) (301GB)
> I stopped it quick that and took out the slashes and reran rsync.

  That changes the command meaning, which is why the deletions.

rsync --blah-blah-blah /home/teddy /media/backup

...is equivalant to...

rsync --blah-blah-blah /home/teddy/ /media/backup/teddy

  The trailing slash after teddy says "do not create a subdirectory at
the destination.  Just copy direct to destination".  To summarize...

rsync --blah-blah-blah /home/teddy fubar/
...copies the contents of teddy to fubar/teddy

rsync --blah-blah-blah /home/teddy/ fubar/
...copies the contents of teddy to fubar

-- 
Walter Dnes <waltdnes-SLHPyeZ9y/tg9hUCZPvPmw at public.gmane.org>
--
The Toronto Linux Users Group.      Meetings: http://gtalug.org/
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists





More information about the Legacy mailing list