I have a cron and its not executing the script, from the cron logs i can see its running in the time but the script is not getting executed for some reason.
14 05 * * * /usr/local/bin/bash /home/sajeesh/bf1_scp.sh > /home/sajeesh/env.output
The above is the cron, and the script does a simple scp of a file to a different server.
cat /home/sajeesh/bf1_scp.sh
#!/bin/bash
PATH=/home/y/bin64:/home/y/bin:/usr/lib64/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/sajeesh/bin
date=20171112
/usr/bin/scp $hostname:/home/logs/my_newsletter/test_3.$date /home/sajeesh/directory
The scripts executes well when i run it manually and fails on cron. I am running the cron as user : sajeesh and not root. ( since root has no keyless login to other node )
Please let me know what i might be missing here.