Stack:
Apache2
Rails 2.3.8
RedHat Linux
Ruby Enterprise 1.8.7
Got the following rake task in my app user's crontab which is meant to pull records into a database table every 15 min:
*/15 * * * * app_user cd /var/www/apps/my_app/current/ && rake thing:do_stuff RAILS_ENV=production
I can see that the cron daemon is running this task in the cron log, but the database table it's supposed to pull records into doesn't change. This task is working without error when I run it manually in the /var/www/apps/my_app/current directory, and pulls records into the table as I expect it to.
I reset the PATH variable in the crontab to reflect using REE, thinking maybe the default path wouldn't jive with /opt/ruby-enterprise...
How do I get this rake task to actually run with cron?
0,15,30,45 * * * * /bin/bash -l -c 'cd /var/www/apps/my_app/current && RAILS_ENV=production bundle exec rake thing:do_stuff --silent'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With