Can't get Cron to work

  • Posted on January 2, 2014
  • boraAsked by bora

Hi guys, I’m having an issue with Cron to work.This is what I have in the crontab, that’s supposed to run every 5 minutes on Thursday:

SHELL=/bin/sh PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin */5 * * * 4 root cd /home/rails/jukely-web && rails runner -e production ‘Pinger.send_test_sms’

But it’s not running. If I execute cd /home/rails/jukely-web && rails runner -e production ‘Pinger.send_test_sms’ from the console it runs fine.

Am I missing something in the syntax or config I wonder. I read the docs and checked the other questions but no dice.

Thanks, Bora

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Just did that and still not working. I’d be happy to give you access to the droplet and put an end to this month long ticket :)

Try creating a file with this as its contents: <br><pre>#!/bin/bash <br>PATH=/usr/local/rvm/gems/ruby-1.9.3-p448/bin/rails:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin <br>cd /home/rails/jukely-web <br>rails runner -e production ‘Pinger.send_test_sms’ </pre> <br>and editing your crontab file to look like this: <br><pre>* * * * * bash /path/to/file</pre>

Yeah I tried removing root before and now again and it didn’t help. I’m happy to give you access to the droplet if you’d like to take a look. Thanks Kamal! <br> <br>Bora