2

I'm stumped on this one. I am using capistrano and whenver gems to manage my builds to prod. Cron is being setup correctly on prod. When I look at 'crontab -e' I see...

# Begin Whenever generated tasks for: nso
10 * * * * /bin/bash -l -c 'cd /home/user/nso/releases/20140130161552 && RAILS_ENV=production bundle exec rake send_reminder_emails --silent >> /var/log/syslog 2>&1'

...this looks correct. In /var/log/syslog I see...

Feb  3 16:10:01 vweb-nso CRON[32186]: (user) CMD (/bin/bash -l -c 'cd /home/user/nso/releases/20140130161552 && RAILS_ENV=production bundle exec rake send_reminder_emails --silent >> /var/log/syslog 2>&1')
Feb  3 16:10:01 vweb-nso postfix/pickup[31636]: 8A67B805C7: uid=1001 from=<user>
Feb  3 16:10:01 vweb-nso postfix/cleanup[32191]: 8A67B805C7: message-id=<20140203211001.8A67B805C7@vweb-nso>
Feb  3 16:10:01 vweb-nso postfix/qmgr[31637]: 8A67B805C7: from=<user@abtech.edu>, size=712, nrcpt=1 (queue active)
Feb  3 16:10:01 vweb-nso postfix/local[32193]: 8A67B805C7: to=<user@abtech.edu>, orig_to=<user>, relay=local, delay=0.03, delays=0.02/0/0/0, dsn=2.0.0, status=sent (delivered to mailbox)
Feb  3 16:10:01 vweb-nso postfix/qmgr[31637]: 8A67B805C7: removed

Everything looks OK there..no?

Addtionally I can manually run the command. At the command prompt if I do.

/bin/bash -l -c 'cd /home/user/nso/releases/20140130161552 && RAILS_ENV=production bundle exec rake send_reminder_emails --silent >> /var/log/syslog 2>&1'

...I get my reminder emails as I should. What am I missing?

Mark Locklear
  • 5,044
  • 1
  • 51
  • 81

1 Answers1

0

So this ended up being my issue...

Rails cron whenever, bundle: command not found

Once I added env :PATH, ENV['PATH'] to the top of config/schedule.rb everything worked as advertised!

Community
  • 1
  • 1
Mark Locklear
  • 5,044
  • 1
  • 51
  • 81