rsync backup

Lennart Sorensen lsorense-1wCw9BSqJbv44Nm34jS7GywD8/FfD2ys at public.gmane.org
Wed Dec 8 23:05:52 UTC 2010


On Wed, Dec 08, 2010 at 12:38:01AM -0500, Jason Nicolaides wrote:
> The --delete flag is not that dangerous and in this case it was doing
> exactly what it was told to do.  There is an undocumented feature, if you
> will, of rsync for the source and destination paths having a trailing slash
> or not.  For the destination path, the presence or not of a trailing slash
> is completely ignored and does not affect rsync in any way.  It's on the
> source that matters.  If the source doesn't have the trailing slash, the
> directory is copied along with it's contents to the destination.  For
> example, if your source is /home/jason and your destination is /mnt/backups
> then after running rsync you will have /mnt/backups/jason.

In rsync man page:
A trailing slash on the source changes this behavior to avoid creating
an additional directory level at the destination.  You can think of a
trailing / on a source as meaning "copy the contents of this directory"
as opposed to "copy the directory by name", but in both cases the
attributes of the containing directory are transferred to the containing
directory on the destination.

Looks pretty documented to me.

-- 
Len Sorensen
--
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