On Apr 24, 2007, at 11:38 PM, Falk Sauer wrote: > On Wednesday 25 April 2007 writes Ross Boylan: >> Does anyone know of a tool/script that will remap one set of uid's >> and >> gid's to another? I.e., if sarah has id 1005 on the original system, >> and I restore it to a system where sarah has id 1004, can I get >> something that will rewrite the id's on the new system to 1004. > > You can use find for your opinion: > > find /path/to/your/restore/ -uid 1021 -exec chown newuser.newgroup > {} \;
The problem with a naive find is that you may be trying to remap UIDs where the old set and the new set have collisions, for exmaple: UID 5 -> UID 7 UID 7 -> UID 5 In this case we need some way of knowing which files have already had their ownerships changed. One way is to combine the change with a move from one directory to another. Another is to create/touch a new temporary file, and use that file with a negated "-cnewer" argument to find. That way find only returns files which have not been changed since you made the tempfile. ("Changed" is updated on permission or file change, "modified" is only for data change.) touch /path/to/tempfile find /path/to/your/restore/ -uid 1234 -not -cnewer '/path/to/ tempfile' -exec "chown newuser.newgroup {}" > This is not a native restore problem, i mean this is only a admin > job for the local operator. I agree that this is an issue which isn't part of Bacula's core functionality. -- --Darien A. Hager [EMAIL PROTECTED] ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ Bacula-users mailing list Bacula-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bacula-users