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=$currentuser@$h:/etc/nginx/
  $RSYNC_CMD "${OPTS[@]}" ${SRC} ${DST}
done

Reply via email to