Re: copy directory tree, mapping to new owners

2021-09-14 Thread Richard Hector
On 14/09/21 6:50 pm, to...@tuxteam.de wrote: On Tue, Sep 14, 2021 at 12:17:05PM +1200, Richard Hector wrote: On 13/09/21 7:04 pm, to...@tuxteam.de wrote: >On Mon, Sep 13, 2021 at 11:45:02AM +1200, Richard Hector wrote: >>On 12/09/21 6:52 pm, john doe wrote: > >[...] > >>>If you are doing this in

Re: copy directory tree, mapping to new owners

2021-09-14 Thread David Wright
On Tue 14 Sep 2021 at 08:50:34 (+0200), to...@tuxteam.de wrote: > On Tue, Sep 14, 2021 at 12:17:05PM +1200, Richard Hector wrote: > > On 13/09/21 7:04 pm, to...@tuxteam.de wrote: > > >On Mon, Sep 13, 2021 at 11:45:02AM +1200, Richard Hector wrote: > > >>On 12/09/21 6:52 pm, john doe wrote: > > > >

Re: copy directory tree, mapping to new owners

2021-09-13 Thread tomas
On Tue, Sep 14, 2021 at 12:17:05PM +1200, Richard Hector wrote: > On 13/09/21 7:04 pm, to...@tuxteam.de wrote: > >On Mon, Sep 13, 2021 at 11:45:02AM +1200, Richard Hector wrote: > >>On 12/09/21 6:52 pm, john doe wrote: > > > >[...] > > > >>>If you are doing this in a script, I would use a temporary

Re: copy directory tree, mapping to new owners

2021-09-13 Thread Richard Hector
On 13/09/21 7:04 pm, to...@tuxteam.de wrote: On Mon, Sep 13, 2021 at 11:45:02AM +1200, Richard Hector wrote: On 12/09/21 6:52 pm, john doe wrote: [...] >If you are doing this in a script, I would use a temporary directory. >That way, in case of failure the destination directory is not rongly

Re: copy directory tree, mapping to new owners

2021-09-13 Thread tomas
On Mon, Sep 13, 2021 at 11:45:02AM +1200, Richard Hector wrote: > On 12/09/21 6:52 pm, john doe wrote: [...] > >If you are doing this in a script, I would use a temporary directory. > >That way, in case of failure the destination directory is not rongly > >modified. > > > >EG: > > > >$ rsync >

Re: copy directory tree, mapping to new owners

2021-09-12 Thread Richard Hector
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).

Re: copy directory tree, mapping to new owners

2021-09-12 Thread Richard Hector
On 12/09/21 6:53 pm, l0f...@tuta.io wrote: # actually not necessary? rsync will create it mkdir -p mysite_test/doc_root You can make a simple test to know that but I would say that rsync doesn't create your destination "root" directory (the one you specify on the command line) unless `--mkpa

Re: copy directory tree, mapping to new owners

2021-09-12 Thread Richard Hector
On 12/09/21 6:52 pm, john doe wrote: On 9/12/2021 3:45 AM, Richard Hector wrote: Thanks, that looks reasonable. It does mean, though, that the files exist for a while with the wrong ownership. That probably doesn't matter, but somehow 'feels wrong' to me. If you are doing this in a script,

Re: copy directory tree, mapping to new owners

2021-09-12 Thread l0f4r0
Hi Curt, 12 sept. 2021, 16:23 de cu...@free.fr: > On 2021-09-12, l0f...@tuta.io wrote: > >> In my opinion, trailing slash doesn't matter for destination folder on >> the contrary of *source* folder. >> > It makes a difference when the source is a file and the destination > directory is inexistan

Re: copy directory tree, mapping to new owners

2021-09-12 Thread Curt
On 2021-09-12, l0f...@tuta.io wrote: >> # The trailing / matters. Does it matter on the source as well? >> # I generally include it. >> rsync -a mysite/doc_root/ mysite_test/doc_root/ # The trailing / >> matters. >> > Actually, I'm not sure to understand Greg's remark here. > > In my opinio

Re: copy directory tree, mapping to new owners

2021-09-12 Thread Andrei POPESCU
On Du, 12 sep 21, 08:52:55, john doe wrote: > On 9/12/2021 3:45 AM, Richard Hector wrote: > > On 12/09/21 12:52 pm, Greg Wooledge wrote: > > > > > > cd /src > > > mkdir -p /dest > > > rsync -a . /dest/  # The trailing / matters. > > > cd /dest > > > find . -user mysite -exec chown mysite_test

Re: copy directory tree, mapping to new owners

2021-09-12 Thread tomas
On Sun, Sep 12, 2021 at 10:46:01AM +0300, Teemu Likonen wrote: [...] > Looks exactly like what "rsync --usermap=FROM:TO" can do. There is also > "--groupmap" option for mapping groups. Never underestimate rsync :-) Actually, I do read its manpage from time to time. Should do it more often, perh

Re: copy directory tree, mapping to new owners

2021-09-12 Thread Teemu Likonen
* 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 permissi

Re: copy directory tree, mapping to new owners

2021-09-12 Thread l0f4r0
12 sept. 2021, 08:53 de l0f...@tuta.io: > 12 sept. 2021, 03:45 de rich...@walnut.gen.nz: > >> # actually not necessary? rsync will create it >> mkdir -p mysite_test/doc_root >> > You can make a simple test to know that but I would say that rsync doesn't > create your destination "root" directory

Re: copy directory tree, mapping to new owners

2021-09-11 Thread l0f4r0
Hi, 12 sept. 2021, 03:45 de rich...@walnut.gen.nz: > On 12/09/21 12:52 pm, Greg Wooledge wrote: > >> cd /src >> mkdir -p /dest >> rsync -a . /dest/ # The trailing / matters. >> cd /dest >> find . -user mysite -exec chown mysite_test {} + >> find . -user mysite-run -exec chown mysite-run_test

Re: copy directory tree, mapping to new owners

2021-09-11 Thread john doe
On 9/12/2021 3:45 AM, Richard Hector wrote: On 12/09/21 12:52 pm, Greg Wooledge wrote: On Sun, Sep 12, 2021 at 12:43:29PM +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 w

Re: copy directory tree, mapping to new owners

2021-09-11 Thread Richard Hector
On 12/09/21 12:52 pm, Greg Wooledge wrote: On Sun, Sep 12, 2021 at 12:43:29PM +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 (actua

Re: copy directory tree, mapping to new owners

2021-09-11 Thread Greg Wooledge
On Sun, Sep 12, 2021 at 12:43:29PM +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 al

copy directory tree, mapping to new owners

2021-09-11 Thread Richard Hector
Hi all, 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 shou