[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: copy directory tree, mapping to new owners



On 12/09/21 7:46 pm, Teemu Likonen wrote:
* 2021-09-12 12:43:29+1200, Richard Hector wrote:

The context of my question is that I'm creating (or updating) a test
copy of a website. The files are owned by one of two owners, depending
on whether they were written by the server (actually php-fpm).

To do that, I want all the permissions to remain the same, but the
ownership should be changed according to a provided map.

Looks exactly like what "rsync --usermap=FROM:TO" can do. There is also
"--groupmap" option for mapping groups.

Aha - thanks a lot :-) I guess I've been caught not reading the man page thoroughly enough. The pitfalls of thinking that you know everything that a tool does, just because you use it often ...

The way the docs are written seems to imply a sender and receiver; I'll have to check it works for a local copy ... it does.

Now I need to rewrite my script somewhat, since to do this it's going to have to run as root ...

Thanks,
Richard


Reply to: