I'm trying to run a scheduled script using django_crontab twice a day. I have tested it locally on ubuntu 18 and it works. However, when I'm trying to run it on the server (python Docker image that runs Django project on remote Ubuntu server) nothing happened. Here is my code:
setting.py:
INSTALLED_APPS = (
.
.
'django_crontab',
.
.
.
)
RONJOBS = [
('0 9,21 * * *', 'appname.folder.file.start')
]
I executed cron by:
$ python manage.py crontab add .
and see the active job:
$ python manage.py crontab show
f95300a5599dc7687ac79ab51c8bb33c -> ('0 9,21 * * *', 'appname.folder.file.start')
def start():
logger.info(" process begins!")
do_something()
Note The function 'start' was tested in the production server and it works.
I also tried to map the chronjob logs by adding path to the CRONJOB at setting.py:
('0 9,21 * * *', 'appname.folder.file.start','>> /Logs/crontab.log')
but the file crontab.log wasn't created.
Any suggestions? Thanks!