I've created a passwordless sftp script to download the file from another server and set a cron job to daily, but, as i checked, files are not up-to-date which means the script didn't run in cron job, so I checked the cron logs using grep "sftpscript.sh" /var/log/cron and saw that the cron job did run as per scheduled, but, the files is not downloaded/updated. What could be the problem here? Thanks.
Cron schedule (
0 8 * * * /directory/of/script.sh
Here's my script:
#!/bin/bash echo "get file*" | sftp $username@$ipaddr:$external_path/ mv file* ./directory