Reputation: 7723
34 7 * * * test_cron > /tmp/stdout.log 2> /tmp/stderr.log
And my executable 'test_cron' contains:
echo "Test cron job ..."
now=$(date)
echo "Cron job update completed at $now"
But when it executes, the stderr is below:
tmp % tail /tmp/std*
==> /tmp/stderr.log <==
/bin/sh: test_cron: command not found
==> /tmp/stdout.log <==
Does it mean it can't find the /bin/sh? How to fix it?
Upvotes: 0
Views: 49
Reputation: 46
Few things you can check
test_cron
have an executable flag? If it doesn't you can run the following command in the dir where the script exists.chmod +x test_cron
test_cron
script exists in the $PATH
?PS: I would recommend writing the absolute path to your test_cron script in your cron config. In this case you won't need to add the script to your $PATH
Upvotes: 1