I want to set up an automatic rsync
job to backup a bunch of user accounts on my OS X machine to a linux fileserver. I have set up password-free ssh from my account to another machine, and it works great, so I tried using this command:
sudo rsync -avz /Users/jbloggs myserv:/var/Backup/
where myserv
is an alias set up in my ~/.ssh/config
. The problem I have is that I have to use sudo to get that command to work -- under my personal account I don't have access to the other users' home directories to copy files for backup. That command works fine on my own account without sudo, but when I run under sudo it's not looking at my ~/.ssh/config
any more (so it complains about "unknown host myserv").
How can I get the rsync running under sudo to still look at my personal ~/.ssh/config
?
Thanks!