I read old topic
And try do the same rsync with options as variable But I get Warning: Identity file $myVar/ssh_key/my_ssh_key not accessible: No such file or directory. My code
options=(-rvz -e 'ssh -p 22 -i "$myVar"/ssh_key/my_ssh_key -o StrictHostKeyChecking=no')
rsync "${options[@]}" /home/user/proj/ pi@${IP}:/home/pi/proj/
Where $myVar is /home/user/proj/
${IP} is IP address 192.168.1.222
Warning: Identity file $myVar/ssh_key/my_ssh_key not accessible: No such file or directory.
This line without $myVar works good
rsync -rvz -e 'ssh -p 22 -i /home/user/proj/ssh_key/my_ssh_key -o StrictHostKeyChecking=no' --progress /home/user/proj/ pi@${IP}:/home/pi/proj/
How I can do rsync with options as variable?