How to log cron jobs?

* * * * * myjob.sh >> /var/log/myjob.log 2>&1 will log all output from the cron job to /var/log/myjob.log You might use mail to send emails. Most systems will send unhandled cron job output by email to root or the corresponding user.

Execute PHP script in cron job

Automated Tasks: Cron Cron is a time-based scheduling service in Linux / Unix-like computer operating systems. Cron job are used to schedule commands to be executed periodically. You can setup commands or scripts, which will repeatedly run at a set time. Cron is one of the most useful tool in Linux or UNIX like operating … Read more

Cron and virtualenv

You should be able to do this by using the python in your virtual environment: /home/my/virtual/bin/python /home/my/project/manage.py command arg EDIT: If your django project isn’t in the PYTHONPATH, then you’ll need to switch to the right directory: cd /home/my/project && /home/my/virtual/bin/python … You can also try to log the failure from cron: cd /home/my/project && … Read more