[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [rdiff-backup-users] Restoring a folder. Uid not correct
From: |
Fran Firman |
Subject: |
Re: [rdiff-backup-users] Restoring a folder. Uid not correct |
Date: |
Mon, 31 May 2004 15:41:18 +1200 |
TO test this out..
On the dest machine, do
find * -printf "%p = %U:%G\n" >owners.txt
sort owners.txt >owner.txt
On source machine use this perl program
#!/usr/bin/perl
open(ChangeUid,">UpdateUID.sh");
open(CheckUid,">CheckUID.txt");
open(CheckP,">CheckPermissions.txt");
open(IN,"zcat $ARGV[0] | ");
while(<IN>) {
chomp();
if($_=~/File/) {
@line=split(/File /,$_);
$File = $line[1];
} elsif ($_=~/Uid/) {
@line=split(/Uid /,$_);
$Uid = $line[1];
} elsif ($_=~/Gid/) {
@line=split(/Gid /,$_);
$Gid = $line[1];
} elsif ($_=~/Permissions/) {
@line=split(/Permissions /,$_);
print ChangeUid "chown $Uid:$Gid \"$File\"\n";
print CheckUid "$File = $Uid:$Gid\n";
printf CheckP "$File = %o\n",$line[1];
}
}
close(IN);
close(ChangeUid);
close(CheckUid);
close(CheckP);
And run with ./test.pl /path/to/the/rdiff-backup-data/mirror-metadata.......gz
file
It will output 3 files.
sort CheckUID.txt >UID.txt
diff UID.txt owner.txt
Can use the UpdateUID.sh to set the uid's on the dest machine correctly.
F.
On Mon, 2004-05-31 at 14:08, Fran Firman wrote:
> I have found a problem when I was doing a restore, regarding the uid and
> gid information.
>
> I have a backup that is like..
>
> mybackup/bin/....
> mybackup/home/....
> mybackup/usr/....
> mybackup/var/.... etc
>
> if I backup with rdiff-backup -r now mybackup/home/ server::/test/home/
> then the uid's gid's are correct.
>
> But if I backup the whole lot with rdiff-backup -r now mybackup
> server::/test/mybackup, the uid's and gid's are not correct.
>
> ie if there are four users under /home
>
> fred = 1000
> jo = 1001
> andrew = 1002
> tom = 1003
>
> I have done one restore where all of the uid's are 1000 and on another
> backup the uid's are all 103
>
> So at the moment I am having to restore via a list of restores, of each
> of the folders, instead of being able to restore the who set in 1 go.
>
>
> UPDATE:
>
> When I restored the home folder with 4 users, as /home to /home, the
> first user had the correct uid's, and the others all had the same uid's
> as the first user.
>
> It is like the uid to restore with is getting overwritten, or not loaded
> correctly.
>
> Cheers
>
> Fran
>
>
> ______________________________________________________________________
> _______________________________________________
> rdiff-backup-users mailing list at address@hidden
> http://lists.nongnu.org/mailman/listinfo/rdiff-backup-users
> Wiki URL: http://rdiff-backup.solutionsfirst.com.au/index.php/RdiffBackupWiki
signature.asc
Description: This is a digitally signed message part