I have a .sh file that I can manually trigger to run a backup to a remote server on the local network. It looks like this:
rsync -avzP -e ssh -i /mnt/local/ [email protected]:/DataVolume/shares/NASBackup
This requires authorization, which is why I created a public key, that I stored in /mnt/local/.backup/authorized_keys.pub
I then created a new .sh script that contains the following
rsync -avzP 'ssh -i /mnt/local/.backup/authorized_keys -o StrictHostKeyChecking=no' /mnt/local 192.168.9.114:/DataVolume/shares/NASBackup
It throws a permission denied error. Specifically the following:
rsync: change_dir "/mnt/local/.backup//ssh -i /mnt/local/.backup" failed: No such file or directory (2)
sent 12 bytes received 12 bytes 48.00 bytes/sec
total size is 0 speedup is 0.00
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1053) [sender=3.0.9]
./backup-start-new.sh: /mnt/local: Permission denied
The reason for the location of the .pub key on the local machine I attempt to run rsync from is due to that my authorized keys folder is unwriteable, so I placed my keys elsewhere. On the remote server, the .pub key is placed in ~/.ssh/authorized_keys
The main problem in the error is the permission denied on the /mnt/local folder that I cant figure out. The originating server is a FreeNAS server.
-e
.~/.ssh
. And check if you have permission for/mnt/local/