I’ve created a custom management command as a py file, in the usual place.
chronograph is installed in the right place and syncd ok.
I’ve created the cron job as the following
* * * * * /home/shofty/virtualenvs/webbricks/bin/chronograph -e /home/shofty/virtualenvs/webbricks/bin/activate_this.py -p /home/shofty/virtualenvs/webbricks/website
ive also tried the following, as i think it may be correct but not whats in the documentation
* * * * * /home/shofty/virtualenvs/webbricks/bin/chronograph -e /home/shofty/virtualenvs/webbricks/bin/activate_this.py -p /home/shofty/virtualenvs/webbricks/website/manage.py cron
I’ve added the manage.py cron because its what you run to tell the chronograph function to look for jobs that need running. if im in my virtual env and i run manage.py cron it works and the job runs.
both jobs are failing to run, but when i try to run them manually, as su or my user, they fail due to permissions denied. not sure what permission they’re referring to. anyone come across this before?
The answer for this was that chronograph.sh has been superseded by chronograph. despite this supposedly being able to activate an env, it wasn’t doing it early enough to import argparse which as far as i can tell isn’t inbuilt to python 2.5 but is in 2.6. then its just down to getting the right combination of arguements for the chronograph script, which for reference is a -p and an -e but not an -s.
also i had to run the script as root but targetting the script inside the users virtualenv.
finally i also had to add site paths for packages directory to the chronograph script as it couldnt find argparse until i did that.