Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 28 Sep 2006 19:35:30 -0500
From:      Paul Schmehl <pauls@utdallas.edu>
To:        freebsd-questions@freebsd.org
Subject:   Re: Sync files locally?
Message-ID:  <BA8646EF367CEAE8037CBFE3@paul-schmehls-powerbook59.local>
In-Reply-To: <451B7AD3.3000107@locolomo.org>
References:  <765A325E54DCF1DC39EBF9AE@utd59514.utdallas.edu> <20060927220439.GC45831@dan.emsphone.com> <F60917F4E6AC408830A588A0@utd59514.utdallas.edu> <451B7AD3.3000107@locolomo.org>

next in thread | previous in thread | raw e-mail | index | archive | help
--==========4C37E6B078144F864C88==========
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
<norgaard@locolomo.org> 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 (pauls@utdallas.edu)
Adjunct Information Security Officer
The University of Texas at Dallas
http://www.utdallas.edu/ir/security/

--==========4C37E6B078144F864C88==========--




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?BA8646EF367CEAE8037CBFE3>