Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cron doesn't seem to run anything #60

Closed
kstange opened this issue Nov 11, 2014 · 4 comments
Closed

Cron doesn't seem to run anything #60

kstange opened this issue Nov 11, 2014 · 4 comments

Comments

@kstange
Copy link

kstange commented Nov 11, 2014

I set up redmine 2.6.0-1 using the init script to add the crontab for the recurring tasks plugin, but it's never actually getting run. I checked inside the container:

root@redmine:~# crontab -l -u redmine
15 */4 * * * cd /home/redmine/redmine && bundle exec rake redmine:recur_tasks RAILS_ENV=production >> log/cron_rake.log 2>&1

crond is running, but it doesn't seem to actually log anything anywhere, and there's no cron_rake.log created, nor are my tasks getting run. If I run the task manually, it works fine.

As a side note, the example cron for the recurring tasks plugin in your documentation is set to run at * */4 * * * which is once per minute for an hour, every 4 hours. I chose 15 */4 * * * for a more reasonable schedule.

@sameersbn
Copy link
Owner

@kstange I added the following to the plugins/init script

crontab -u redmine -l 2>/dev/null >/tmp/cron.redmine
echo '* * * * * date >> /tmp/date.log' >>/tmp/cron.redmine
crontab -u redmine /tmp/cron.redmine 2>/dev/null
rm -rf /tmp/cron.redmine

I can see that the date is being output to the /tmp/date.log file every minute. Can you try this?

As a side note, the example cron for the recurring tasks plugin in your documentation is set to run at * */4 * * * which is once per minute for an hour, every 4 hours. I chose 15 */4 * * * for a more reasonable schedule.

This line is directly taken from the recurring_tasks readme. You are free to choose whatever schedule you desire.

@kstange
Copy link
Author

kstange commented Nov 12, 2014

I meant that the line on the recurring_tasks readme is an insane example and that I would recommend not advising people to use it! I was planning to contact the recurring_tasks maintainer to suggest the same.

Date is working correctly. I think that the problem is that the cron PATH value is set to

PATH='/usr/bin:/bin'

bundle is in /usr/local/bin/

So the correct revision should be:

15 */4 * * * cd /home/redmine/redmine && /usr/local/bin/bundle exec rake redmine:recur_tasks RAILS_ENV=production >> log/cron_rake.log 2>&1

@sameersbn
Copy link
Owner

@kstange ahhh... does that work for you. If yes, then I will update the readme.

@kstange
Copy link
Author

kstange commented Nov 12, 2014

@sameersbn Yes, it works now! Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants