Closed matburnham closed 2 years ago
I don't know whether this is supported, however, as a workaround, you could give your model a day to run on (0-6, Mon-Sun), and then run your CronJob daily (e.g., RUN_AT_TIMES = ['1:30']
) and in your management command check to see if it is the right day using timezone.localtime(timezone.now()).weekday()
, and only run the command if it is that day.
Sounds like a good workaround @gregschmit. Thanks.
We have done something similar for running jobs monthly
Take a look at Run weekly feature: https://github.com/Tivix/django-cron/blob/master/docs/sample_cron_configurations.rst
I'm trying to run a backup task once a week. The following runs a daily backup, but the weekly doesn't seem to happen. It's rather difficult to debug as I only want it to happen once a week!
Is running less often than daily supported? Is there a better way to do this?