-
Notifications
You must be signed in to change notification settings - Fork 189
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
runcrons is once-and-for-all? #21
Comments
Yes, you miss something ("runcrons" is not background deamon). From documentation: "Now everytime you run the management command python manage.py runcrons all the crons will run if required. Depending on the application the management command can be called from the Unix crontab as often as required. Every 5 minutes usually works for most of my applications." That means you have to put "runcrons" command in your crontab. Example: You have some CronJob that do something every 30 min. To get this running you must edit you crontab (linux, mac) or task scheduler (windows) to run "python manage.py runcrons" for every, let say 1 min. If you get this running, your CronJob will be pinged every 1 min and run if necessary (every 30 min or whatever value you have set). Hope this helps. |
Thanks I notice you have answered my question on SO as well:) Let's move over there. It might benefit more people. And may I suggest you add this answer to project wiki? It clarify things for newbies like me. I once thought the purpose of your app is to by-pass crontab entirely. |
This is like creating cron job on top of another cron job. |
I also experienced this issue until finding this ticket. Documentation could use further clarification. "everytime you run the management command python manage.py runcrons all the crons will run if required." indicates to me that manage.py runcrons starts a recurring cron job |
Link to the SO question, for posterity? |
I don't understand the point of setting schedule in django-cron, If we are setting it using the windows task scheduler. |
@shivamsinghal212 The idea is that your window task scheduler will invoke |
The following cron job class is intended to send email every min once running "runcrons" command. But in fact, it only sends out one email every time I run runcrons command (instead of send one email per minute). That defeats the purpose of cron... Am I missing something?
class TestCron(CronJobBase):
schedule = Schedule(run_every_mins=1)
code = 'test_cron_philip'
The text was updated successfully, but these errors were encountered: