rsync - Management of UIDs and GIDs when reserved on a Remote system

Simon Hobson linux at thehobsons.co.uk
Tue May 19 02:10:04 MDT 2015


Kevin Korb <kmk at sanitarium.net> wrote:

> No, rsync would store the files with the numeric UID and GID as is on
> the source without regard to the existence or non-existence of a
> matching account.  This could mean that ls would show numbers in those
> columns, or incorrect names in those columns, or (perhaps by
> coincidence) show the correct names in those columns.  The important
> thing is that if you backup and restore with --numeric-ids you will
> get back what you started with regardless of what the backup system
> thinks about the data.

Yes, that's what I do for my backups. Since the backup system doesn't have the same software (and hence S/W specific users) as the various systems I back up, it means a lot of files with numeric owner/group - and of course, some with seemingly strange ownership where the backup system has a different user/group for the same ID !
If you have to restore, then the system you restore to needs to have the same passwd and group files - which is not a problem when you are restoring files to the same machine, or restoring the entire machine (in which case the passwd and group files come back with the rest of the files during the restore.

The problem is if you need to restore to a different machine - in that case you will have problems. There isn't an easy way round that.

So you either use numeric IDs in which case the backup is the same as your source; or you don't, in which case you need to do some careful user-id and group-id management to avoid problems (ie ensure that the destination has a user and group name to match ever name used on every source) and rsync will match names.



More information about the rsync mailing list