I'm new - Very new to UNIX and have been dropped in the deep end.
I an trying to automate the transfer of files from a remote SFTP server back to our SFTP server, I need to login using an SSH private.
I have managed to muddle my way through this with a full hands on approach but when I try to do it from a cron job I get the following error straight away:
/bin/sh: 1: /home/administrator/from_cepsa_to_SFTP.sh: Permission denied
I'm not sure where this comes from as it isn't in my script as below:
sftp -i /home/administrator/key/key.txt [email protected]
sftp> cd /out
sftp> lcd /home/administrator/key
sftp> get key2.txt
sftp> cd /out/processed
sftp> put key2.txt
sftp> cd /out
sftp> rm key2.txt
Removing /out/key2.txt
sftp> exit
Now I might be being hopeful that I can just take what I used in the manual entries and turn it into a script but I would be really grateful for any pointers/advice and support please?
What I have noticed from a previous script to do similar is it calls:
sshpass -e sftp -oBatchMode=no -oport=61140 -oHostKeyAlgorithms=+ssh-dss -b - [email protected] << !
I know I am not using 'sshpass' but I guess I'm missing something to call the SSH SFTP transfer
thank you :)
echo something
- Though once you resolve this - Your script does not even look like a script, it cannot work, even if you run it manually.