1

I am backing up a networked server via SSH. Unfortunately, I can't seem to figure out how to get root access to the networked server with Rsync. I am using the following command to perform the backup:

sudo rsync -av ubuntu@*******:/ /media/backup1/ubuntubackup

Some directories come up as permission denied. Once I log in through Rsync, the backup just starts and there is no way to issue the sudo command. I understand that I can use the Rsync daemon to get around this, but I would like to use SSH without the daemon for the sake of simplicity. Does anyone know a way to accomplish this? Any help would be greatly appreciated.

1
  • Is this on Amazon Cloud? – user8290 Jan 1 '12 at 0:53
2

I believe the issue is you are taking 'sudo' on the local box and not on the remote server. I have not verified this, but a structure like the following should work:

rsync -R -avz -e ssh --rsync-path="echo mypassword | \
    sudo rsync" /media/backup1/ubuntubackup ubuntu@*******:/ /media/backup1/ubuntubackup

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.