rsync-mail-gateway@nasbackup.com
2006-Oct-12 10:16 UTC
backup system files (and permissions) over ssh
how do you backup system files like /etc/ over ssh to another machine and keep permissions the same on the remote backup location ? i tried using -a flag, but because i'm connecting through ssh i'm not using Rsync module on the remote computer and therefore i cant write files as root so -a flag is not working. all the files are being written with owner SSH_USER and group SSH_USER_GROUP i think the problem is here (from rsync man) : -o, --owner preserve owner (root only) and SSH_USER is neither root nor rsync module that can run as root my Rsync command is: rsync -e "ssh -i key_path" -a flags excludes local_path ssh_user@server2:/full/path is there a way to do what i'm trying WITHOUT giving root ssh access ? ---------------------------------------- Read this topic online here: Sent using Mail2Forum (http://www.mail2forum.com). http://forums.nasbackup.com/viewtopic.php?p=4048#4048 ---------------------------------------- -------------- next part -------------- HTML attachment scrubbed and removed
2006/10/12, rsync-mail-gateway@nasbackup.com <rsync-mail-gateway@nasbackup.com>:> is there a way to do what i'm trying WITHOUT giving root ssh access ?With root: http://www.jdmz.net/ssh/ Without root: Use a non-root account and use passwordless sudo in the script. Best Martin
rsync-mail-gateway@nasbackup.com
2006-Oct-12 15:24 UTC
backup system files (and permissions) over ssh
Quote: "Without root: Use a non-root account and use passwordless sudo in the script." sounds interesting, can you explain how am i suppose to do that ? who runs the script ? when ? thanks ---------------------------------------- Read this topic online here: Sent using Mail2Forum (http://www.mail2forum.com). http://forums.nasbackup.com/viewtopic.php?p=4058#4058 ---------------------------------------- -------------- next part -------------- HTML attachment scrubbed and removed
2006/10/12, rsync-mail-gateway@nasbackup.com <rsync-mail-gateway@nasbackup.com>:> Quote: > "Without root: Use a non-root account and use passwordless sudo in the > script." > > sounds interesting, can you explain how am i suppose to do that ? > who runs the script ? when ?See the url I provided. :-) Best Martin
rsync-mail-gateway@nasbackup.com
2006-Oct-12 17:29 UTC
backup system files (and permissions) over ssh
martin at oneiros.de wrote:> 2006/10/12, rsync-mail-gateway@nasbackup.com <rsync-mail-gateway@nasbackup.com>: > > > Quote: > > "Without root: Use a non-root account and use passwordless sudo in the > > script." > > > > sounds interesting, can you explain how am i suppose to do that ? > > who runs the script ? when ? > > > > See the url I provided. :-) > > Best > Martin > -- > To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync > Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.htmli didnt see any SUDO mentioned there. did you mean the CRON script ? my backup already runs under cron(root) but SSH_USER is the one that writes files on the remote machine. ---------------------------------------- Read this topic online here: Sent using Mail2Forum (http://www.mail2forum.com). http://forums.nasbackup.com/viewtopic.php?p=4061#4061 ---------------------------------------- -------------- next part -------------- HTML attachment scrubbed and removed
2006/10/12, rsync-mail-gateway@nasbackup.com> See the url I provided.> i didnt see any SUDO mentioned there.validate-rsync calls rsync through sudo. Please get a name and switch of HTML. HTH. HAND Martin
On Thu, Oct 12, 2006 at 12:19:14PM +0200, rsync-mail-gateway@nasbackup.com wrote:> how do you backup system files like /etc/ over ssh to another machine > and keep permissions the same on the remote backup location ?One possibility you can try is to use a program that lets rsync pretend to be root, such as fakeroot or pretendroot. I have fakeroot here that I've used for small tasks. For instance: WHO=/backup/foo rsync -av --rsync-path="fakeroot -s $WHO.fake -i $WHO.fake -- rsync" \ /local/ host:$WHO/ As long as you never change the files in /backup/foo without using fakeroot, you should be fine. E.g. if a user on host wants to change something in /backup/foo, they would need to run fakeroot: cd /backup fakeroot -s foo.fake -i foo.fake # starts a shell cd foo ... exit The fakeroot command stores attributes for things that can't be done the save file (foo.fake). It doesn't appear to be a very efficient save file, though, so you'd need to test how well it performs. Also, it doesn't appear to handle simultaneous updates at all. ..wayne..