rdiff-backup-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [rdiff-backup-users] User/Group Permissions Question - IS THIS A BUG


From: Francisco M. Marzoa Alonso
Subject: Re: [rdiff-backup-users] User/Group Permissions Question - IS THIS A BUG?
Date: Mon, 23 Feb 2009 20:16:36 +0100
User-agent: Thunderbird 2.0.0.19 (X11/20090105)

It seems like --preserve-numerical-ids option isn't working right on
rdiff-backup, or perhaps we're missundestading how it works, because I
can reproduce the problem you say, and it's not preserving uid and gid
as it should, according to 'man rdiff-backup'. Even using "rdiff-backup
-r now" it does NOT recover uid:gid original ownership. See this:

address@hidden:~$ ls -al test
total 8
drwxr-xr-x  2 fmmarzoa devel    4096 2009-02-23 20:07 .
drwxr-xr-x 77 fmmarzoa fmmarzoa 4096 2009-02-23 20:07 ..
-rw-r--r--  1 fmmarzoa devel       0 2009-02-23 20:07 testfile

I've a directory called "test" with uid:gid as fmmarzoa:devel, and a testfile 
within the directory with same ownership. Now I backup it with:

address@hidden:~$ rdiff-backup --preserve-numerical-ids test test_backup
address@hidden:~$ ls -la test_backup
total 12
drwxr-xr-x  3 fmmarzoa fmmarzoa 4096 2009-02-23 20:07 .
drwxr-xr-x 78 fmmarzoa fmmarzoa 4096 2009-02-23 20:10 ..
drwx------  3 fmmarzoa fmmarzoa 4096 2009-02-23 20:10 rdiff-backup-data
-rw-r--r--  1 fmmarzoa fmmarzoa    0 2009-02-23 20:07 testfile

So in fact, ownership information has been lost. Obviously restoring just doing 
a "cp test_backup test" will not recover the ownership data, but restore 
command neither!:

address@hidden:~$ rdiff-backup -r now test_backup test
address@hidden:~$ ls -la test
total 8
drwxr-xr-x  2 fmmarzoa fmmarzoa 4096 2009-02-23 20:07 .
drwxr-xr-x 78 fmmarzoa fmmarzoa 4096 2009-02-23 20:12 ..
-rw-r--r--  1 fmmarzoa fmmarzoa    0 2009-02-23 20:07 testfile


It seems to be a bug, or a missunderstanding of --perserve-numerical-ids by me.

BTW: 
address@hidden:~$ rdiff-backup -V
rdiff-backup 1.1.15


P.S. Damon, you can use 'stat' command to do many things, including getting 
permission mask and user and group of a file. See 'man stat' for that.



Damon Timm escribió:
> Hi Francisco - thanks for the idea!  See below:
>
> On Mon, Feb 23, 2009 at 1:12 PM, Francisco M. Marzoa Alonso
> <address@hidden> wrote:
>   
>> You could do:
>>
>> sudo -u pepe rdiff-backup /backups/pepe /home/pepe
>> sudo -u juan rdiff-backup /backups/juan /home/juan
>> sudo -u maria rdiff-backup /backups/maria /home/maria
>>
>>     
>
> My setup is like this:
>
> user1:user1 /home/user1
> user2:user2 /home/user2
> root:sharedgroup /home/sharedgroup
>
> user1 and user2 are members of sharedgroup and the /home/sharedgroup
> folder has g+ws permissions ... this is a shared folder for projects
> and the umask is set to 002 so that all files are rw by the group ...
> but, when I run:
>
> sudo -u user1 rdiff-backup --preserver-numerical-ids /home/sharedgroup
> /mnt/backup/sharedgroup
>
> Inside the backup, the group ID for all the files is set to user1 --
> it does preserve the right permissions (That is, g+rw) but it doesn't
> keep the right group ID.  If i just run a plain sudo command:
>
> sudo rdiff-backup --preserver-numerical-ids /home/sharedgroup
> /mnt/backup/sharedgroup
>
> Then both the ID and the permissions are preserved, but the
> rdiff-backup-data is owned by root ... which is the problem I started
> with ...
>
>   
>> You can even do it better with an script and the help of "stat" command,
>> something in this way:
>>
>> for DNAME in $(find /home -maxdepth 1 -mindepth 1 -type d);
>> do
>>    USER=$(stat -c %U $DNAME);
>>    sudo -u $USER rdiff-backup $DNAME /backups/$USER;
>> done
>>
>> It's just an idea, may be helpful (or not!) ;-)
>>     
>
> Since this is going to be run as a cron item, could I just manually
> change the permissions of the "rdiff-backup-data" folder to the
> sharedgroup and then add g+r permissions recursively ?
>
> sudo chown -R :sharedgroup rdiff-backup-data
> sudo chmod -R g+rx rdiff-backup-data
>
> ??
>
> I could put this at the end of the script.
>
> Thanks,
> Damon
>
>
>
>
>   
>>> I tried using --preserve-numerical-ids ... but, the rdiff-backup-data
>>> is still owned by root ...
>>>
>>> Any ideas?
>>>
>>> Thanks,
>>> Damon
>>>
>>>
>>> _______________________________________________
>>> 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
>>>
>>>
>>>       
>>     
>
>
> _______________________________________________
> 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
>
>   





reply via email to

[Prev in Thread] Current Thread [Next in Thread]