This question already has an answer here:
I'm trying to get my crontab to run a few rake tasks for a rails app, but it seems to always exit with the status of 127, in my syslog it look like this:
Jun 7 05:10:01 ip-10-170-122-226 CRON: (deploy) CMD (cd /home/deploy/apps/dashboard/current && bundle exec rake some:task Jun 7 05:10:01 ip-10-170-122-226 CRON: (CRON) error (grandchild #15664 failed with exit status 127)
It seems that 127 is like "command not found error" or something, so I've used the full paths to the bins even so like bundle was
/usr/local/bin/bundle, The task runs fine outside of cron just running it in shell.
My crontab is simplily just:
*/10 * * * * cd /home/deploy/apps/dashboard/current && bundle exec rake some:task
Does maybe my crontab need
#!/usr/bin or something at the top?
To just test it, it does seem to run this just fine:
*/1 * * * * /usr/bin/touch /home/deploy/cron-test.txt
So that leads me to think its like a PATH varible thing, but I don't know how to get the right path vars in there, any thoughts?