[Answer]-Crontab Django script on webfactional

0👍

The way I got it working was the following:

make a bash file that includes the following:

PYTHONPATH=/home/my_username/webapps/bip/lib:/home/my_username/webapps/bip/lib/python2.7:/home/my_username/webapps/bip/bip:/home/my_username/webapps/bip/bip/project
DJANGO_SETTINGS_MODULE=project.settings

/usr/local/bin/python2.7 ~/webapps/bip/bip/project/manage.py my_script_name &>> ~/logs/user/my_script_name

and on the crontab the following:

0 0 * * * cd ~/bin/;./my_bash_file.sh >> $HOME/logs/user/cron.log 2>&1

1👍

Place this in your crontab so you can read the logs.

0 0 * * * /usr/local/bin/python2.7 ~/webapps/bip/bip/project/manage.py my_script_name &>> ~/logs/user/my_script_name

This will allow you to see the output of the script and whatever has gone wrong.

👤Thomas

Leave a comment