I am trying to make a bash script to send a file. When running this in the terminal I get the error:
line 4: warning: here-document at line 2 delimited by end-of-file (wanted `EOF
Here is the script:
#!/bin/bash
sshpass -p 'password' scp /dir/sub/sub/sub/sub/file.csv [email protected]:/ <<-EOF
quit
EOF
It will send the file but when I have tried to run the script with crontab it will not run. What do I need to change? Also I am only able to use a password and not keys.
I tested the following code to work:
cron job script:
cron-job--scp-files-locally.sh
crontab line for current user is:
Output test:
ls -1 /tmp/*ind
Summery
Suggested cron job script: