Hello everybody, I am discovering rsync and I have a problem about preserving ownership and permissions. I want to mirror a web tree with rsync over ssh. I set up a module on my rsync server and on the rsync client, I use the options -o and -p in order to preserve ownership et permissions. The file are transffered via rsync but on the rsync server the files are owned by the user used to connect with ssh. I tried to find some docs but I found nothing and the man page is not clear for me : -- perms ==> root only what does that mean exactly ? I hope some one will be able to help me :) Thank you for your answers Best regards, ptitoliv
Only root *CAN* change the owner of a file to somebody else. If we both have accounts on the same box. I cannot stick *your* name as responsible for *my* garbage. -----Original Message----- From: rsync-bounces+tony=servacorp.com@lists.samba.org [mailto:rsync-bounces+tony=servacorp.com@lists.samba.org]On Behalf Of Olivier BONHOMME Sent: Monday, August 01, 2005 8:57 AM To: rsync@lists.samba.org Subject: How to preserve ownership with rsync over SSH Hello everybody, I am discovering rsync and I have a problem about preserving ownership and permissions. I want to mirror a web tree with rsync over ssh. I set up a module on my rsync server and on the rsync client, I use the options -o and -p in order to preserve ownership et permissions. The file are transffered via rsync but on the rsync server the files are owned by the user used to connect with ssh. I tried to find some docs but I found nothing and the man page is not clear for me : -- perms ==> root only what does that mean exactly ? I hope some one will be able to help me :) Thank you for your answers Best regards, ptitoliv -- To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html
On Monday 01 Aug 2005 14:56, Olivier BONHOMME wrote:> Hello everybody, > > I am discovering rsync and I have a problem about preserving ownership > and permissions. I want to mirror a web tree with rsync over ssh. I set > up a module on my rsync server and on the rsync client, I use the > options -o and -p in order to preserve ownership et permissions. The > file are transffered via rsync but on the rsync server the files are > owned by the user used to connect with ssh. I tried to find some docs > but I found nothing and the man page is not clear for me : -- perms ==> > root only what does that mean exactly ?You need to be root at both ends. If you are using ssh you don't need to set up rsync modules. If you use ssh keys so that there is no login involved then it can be done automatically on a cronjob. cd /my/backup/dir rsync -a -v root@mydomain.com:/dir/to/be/backedup . (note the dot on the end, and the single :) use the -v first time so you can see it, once its all working get rid of it. You might also want to use -z for compression, and --exclude to *not* copy some files. HTH -- ----------------- Bob Hutchinson Midwales dot com -----------------