Re: [Hampshire] rsync

Top Page

Reply to this message
Author: Michael James Daffin
Date:  
To: Hampshire LUG Discussion List
Subject: Re: [Hampshire] rsync
On 5 November 2012 19:29, Keith Edmunds <kae@???> wrote:

> On Mon, 5 Nov 2012 19:26:16 +0000, kae@??? said:
>
> > $ rsync -av --delete /mnt/foo/* /mnt/goo
>
> Note that this will not copy hidden files in /mnt/foo (although it will
> copy hidden files in subdirectories). If you need hidden files in /mnt/foo
> copied then I would do:
>
>         $ rsync -av --delete /mnt/foo /mnt/goo

>
> ...which will create /mnt/goo/foo as an exact replica of /mnt/foo.
>
>

Unless /mnt/goo exists then it will create /mnt/goo/foo as an exact replica
of /mnt/foo
Use $ rsync -av --delete /mnt/foo/ /mnt/goo
To copy the contents whether the dest exists or not (this has bitten me
before).

From the man page:
        rsync -avz foo:src/bar/ /data/tmp


       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.  In
other words, each of the following commands
       copies the files in the same way, including their setting of the
attributes of /dest/foo:



--
Michael Daffin <james1479@???>
--
Please post to: Hampshire@???
Web Interface: https://mailman.lug.org.uk/mailman/listinfo/hampshire
LUG URL: http://www.hantslug.org.uk
--------------------------------------------------------------