er, I am bound by rules in my company to run
commands as users and not the root user.
I have setup keys for ssh for all my sysadmin users, and it works fine if I
just us it.
rsync -q -avz --delete -e 'ssh -i /home/dpich/.ssh/id_rsa' --rsync-path='sudo
rsync' /etc/nginx/ dp
Thanks for the advise!
That did it. The command is working fine now with the following setup:
currentuser="$(id -u -n)"
OPTS=(-q -avz --delete -e 'ssh -i /home/'$currentuser'/.ssh/id_rsa'
--rsync-path='sudo rsync')
SRC=(/etc/nginx/)
RSYNC_CMD=(rsync)
for h in balancer0{1..2} ; do
DST=$curren