We have a cron script meant to run Salt in our environment along with several other steps, but for some reason it isn't executing it at all.
root@salt:~# cat /etc/cron.hourly/salt-apply.sh
#!/bin/bash
/bin/cat << EOF | /bin/bash 2>&1 > /var/log/salt-apply.log
/bin/date
cd /srv/salt
/usr/bin/git pull
/usr/bin/salt '*' saltutil.sync_all
/usr/bin/salt '*' state.apply
/bin/date
EOF
root@salt:~# ls -l /etc/cron.hourly/salt-apply.sh
-rwxr-xr-x 1 root root 199 Feb 7 22:47 /etc/cron.hourly/salt-apply.sh
It doesn't run, no errors are present in /var/log/salt-apply.log, and cron does appear to be running the hourly run-parts:
root@salt:~# grep -i cron.hourly /var/log/syslog | tail -n 5
Feb 7 22:17:01 salt CRON[6941]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)
Feb 7 23:17:01 salt CRON[8817]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)
Feb 8 00:17:01 salt CRON[10450]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)
Feb 8 01:17:01 salt CRON[12104]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)
Feb 8 02:17:01 salt CRON[13761]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)
And yes, the script runs fine if you just execute it at a shell prompt.
Any help would the greatly appreciated. Thanks!