Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 28 Sep 2006 19:35:30 -0500
From:      Paul Schmehl <>
Subject:   Re: Sync files locally?
Message-ID:  <BA8646EF367CEAE8037CBFE3@paul-schmehls-powerbook59.local>
In-Reply-To: <>
References:  <> <> <> <>

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

--On September 28, 2006 9:33:39 AM +0200 Erik Norgaard=20
<> wrote:
> 1) rsync changes behaviour depending on whether or not you include a
> trailing / from the man-page:
>         rsync -av /src/foo /dest
>         rsync -av /src/foo/ /dest/foo
That I know.

> works the same way, (and sync locally in this example). Read the man
> page, there are lots of examples.
> 2) The options -t and -p preserve time and permissions respectively.
> Ownership will always change to the user running rsync unless you run as
> root. This has nothing to do with rsync, you can't run chown as an
> ordinary user.
> You can preserve the group if you're in that group on the destination
> host.
> 3) The files you are syncing - should they be writeable by www? For
> security, you may really want something like this:
>    -rw-r----- user:www    file
They're user:www, but the user isn't me.  :-)

I could go into the reasons for that, but it doesn't really matter.

> and have user do the rsync. If you really need to have www write to the
> file, set group permissions +w.
No, I don't need that and don't want it either.  The owners of the site=20
own the files, and I know how to use sudo.  :-)
> IIRC to run rsync over ssh the user doing the syncing must have shell
> access, running your sync as root is not desirable, it MAY be preferred
> to have it run as www to preserve owner also, at least you can restrict
> access for www.
I use ssh with keys so I can cron the job, but I'll have to do the extra=20
step of fixing perms and ownership after copying the rsynced files over.=20
No big deal.  I'll script that as well.

Paul Schmehl (
Adjunct Information Security Officer
The University of Texas at Dallas


Want to link to this message? Use this URL: <>