Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[solved] Rsync to backup a system without root account
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
ultraViolet
Apprentice
Apprentice


Joined: 03 Apr 2004
Posts: 280
Location: Lyon, France

PostPosted: Thu Mar 13, 2014 3:13 pm    Post subject: [solved] Rsync to backup a system without root account Reply with quote

Hi ! A long time I didn't come here. Got a new job, in which I have to work... with gentoo servers :-)

So, I have a question :

I have to backup a server using rsync to make a perfect bootable clone in case of major failure of the original. To do that, I use rsync :

Code:
rsync --delete --progress --numeric-ids -aHAv -e ssh--exclude-from=excludefile.txt --backup --backup-dir=mybackupdir / root@myserver:/save/


This work pretty well, but as you can see, the server which copy itself logs as root on the other one. I was wondering if I could use another account on the target server, which would have full rights on the save folder ? As he will have to give root rights to some of the files copied, will the --numeric-ids bypass the problem ?

I hope my question is not too stupid, I forgot a lot... but I am happy to see you all again :-)


Last edited by ultraViolet on Fri Mar 14, 2014 7:44 am; edited 1 time in total
Back to top
View user's profile Send private message
Hu
Watchman
Watchman


Joined: 06 Mar 2007
Posts: 8929

PostPosted: Fri Mar 14, 2014 1:36 am    Post subject: Reply with quote

Only a user with CAP_CHOWN can change the owner of files. However, if you only need to archive the data, but do not need the target to be directly bootable, you could instruct rsync to use xattrs on the target to record what the ownership would have been, if it had been able to set the owner. See rsync option --fake-super in the man page for full details.
Back to top
View user's profile Send private message
ultraViolet
Apprentice
Apprentice


Joined: 03 Apr 2004
Posts: 280
Location: Lyon, France

PostPosted: Fri Mar 14, 2014 7:46 am    Post subject: Reply with quote

Thanks for your answer. --fake-super was the rsync option I missed...
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum