I have a file:
/etc/bind/dnsCron/dnsCron.sh
I run it via cron every 5 minutes:
*/5 * * * * sh /etc/bind/dnsCron/dnsCron.sh
Inside dnsCron.sh
I have a line that succeeds when I run it command line .. But it fails in the cron -- Error log:
/etc/bind/dnsCron/dnsCron.sh: 124: /etc/bind/dnsCron/dnsCron.sh: named-checkconf: not found
The line(s) in question: dnsCron.sh
>/etc/bind/dnsCron/checkconf
named-checkconf -z > /etc/bind/dnsCron/checkconf
Is there anything wrong with running a subshell
in an shell script
called by crontab
? I have a feeling it doesn't like me calling named-checkconf directly. What's the correct way to get named-checkconf -z
results into the file checkconf
when run through crontab
?