View previous topic :: View next topic |
Author |
Message |
ultraViolet Apprentice
Joined: 03 Apr 2004 Posts: 280 Location: Lyon, France
|
Posted: Thu Mar 13, 2014 3:13 pm Post subject: [solved] Rsync to backup a system without root account |
|
|
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 |
|
|
Hu Moderator
Joined: 06 Mar 2007 Posts: 21624
|
Posted: Fri Mar 14, 2014 1:36 am Post subject: |
|
|
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 |
|
|
ultraViolet Apprentice
Joined: 03 Apr 2004 Posts: 280 Location: Lyon, France
|
Posted: Fri Mar 14, 2014 7:46 am Post subject: |
|
|
Thanks for your answer. --fake-super was the rsync option I missed... |
|
Back to top |
|
|
|
|
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
|
|