Quantcast
Viewing latest article 47
Browse Latest Browse All 48

Answer by Adam Matan for Why crontab scripts are not working?

Absolute path should be used for scripts:

For example, /bin/grep should be used instead of grep:

# m h  dom mon dow   command0 0 *  *  *  /bin/grep ERROR /home/adam/run.log &> /tmp/errors

Instead of:

# m h  dom mon dow   command0 0 *  *  *  grep ERROR /home/adam/run.log &> /tmp/errors

This is especially tricky, because the same command will work when executed from shell. The reason is that cron does not have the same PATH environment variable as the user.


Viewing latest article 47
Browse Latest Browse All 48

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>