I found this helpful re /3:
https://serverfault.com/questions/373058/comparing-owners-and-permissions-of-content-of-two-folders
If there's any gotchas that jump out - jump on in.
M
On 08/12/2024 2:28 pm, Morgan Read wrote:> Hello List,
>
> I've been running rsync for must be 20 years by now, but over that time
> the holes in the Swiss cheese that passes for my brain seem to have
> grown larger and been filled with budgie seed and sawdust.
>
> I once used rsync as my regular backup solution but now settle for a
> borg backend with pika up front and perhaps the lack of regular use
> caused me to run:
> `[admin at server mymachine-home]$ rsync -aAX root at 192.168.1.141:/home/
.`
> And, after doing what I needed to do with /home on mymachine, I put it
> all back:
> `[admin at server mymachine-home]$ rsync -avAX . root at
192.168.1.141:/home/`
> Only to discover - obviously in hindsight - that I'd failed to run as
> root and now the whole of /home (appears) to belongs to `admin` (a user
> that doesn't exist on mymachine).
>
> So, my strategy:
> 1/ Assume that the wrong owner is the only problem thown up by the above
> - is that assumption correct?
> 2/ Recursively chown each users home directory to their corect owner;
> 3/ Use borg/ pika to mount a recent backup and diff the ownership
> between the backup and respective home directory to discover anything
> owned by something other than the respective user - and labouriously
> correct.
>
> I wonder if anyone would be good enough to confirm whether or not the
> above sounds like a reasonable strategy?
>
> Very many thanks for listening.
>
> M
--
Morgan Read
Grande Bretagne
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL:
<http://lists.samba.org/pipermail/rsync/attachments/20241208/61fff767/OpenPGP_signature.sig>