chrisspen/django-chroniker

chroniker not running through cron

m-misseri opened this issue · 1 comments

Hi there,

I have a very strange problem.

this is my cron configuration file:

* * * * * /home/ah/cron.sh >> /tmp/log-cron.output
* * * * * env >> /tmp/log-cron.output

This is my cron.sh file (/home/ah/cron.sh):

#!/bin/bash
echo "chroniker 1"
/var/www/ah/venv/bin/chroniker -s=ah.settings.production -e /var/www/ah/venv/bin/activate_this.py -p /var/www/ah
echo "chroniker 2"

this is the output of /tmp/log-cron.output:

chroniker 1
HOME=/home/ah
LOGNAME=ah
PATH=/usr/bin:/bin
LANG=en_US.UTF-8
SHELL=/bin/sh
PWD=/home/ah
chroniker 2

In this way, I dont know why, /var/www/ah/venv/bin/chroniker is not executed and it does not print out any output.

Instead if I run directly through my terminal, this command:

ah@ubuntu-512mb-fra1-01:~$ sh /home/ah/cron.sh
chroniker 1
PID dead.
PID dead.
PID dead.
0 total stale jobs.
0 Jobs are due.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
All jobs complete!
chroniker 2

As you can see chroniker is running and it print out output.

The question is: Why through cron is not working and it does not print out any output?
Cron is working, because the output containts "chroniker 1" && "chroniker 2" every minute.

Let me know,
Thanks

Solved by launching python manage.py cron instead.