Translate Toolkit & Pootle

Tools to help you make your software local

User Tools

Running Pootle commands in cron

If you want to schedule certain actions on your Pootle server, using management commands with cron might be a solution.

The management commands can perform certain batch commands which you might want to have executed periodically without user intervention.

For the full details on how to configure cron, view the Wikipedia page or your platform documentation (for example “man crontab”). Here is an example that runs the “refresh_stats” command daily at 02:00 AM:

00 02 * * * www-data /var/www/sites/pootle/ refresh_stats

Test your command with the parameters you want from the command line. Insert it in the cron table, and ensure that it is executed as the correct user (the same as your web server) like www-data, for example. The user executing the command is specified in the sixth column. Cron might report errors through local mail, but it might also be useful to look at the logs in /var/log/cron/, for example.

If you are running Pootle from a virtualenv, or if you set any custom PYTHONPATH or similar, you might need to run your management command from a bash script that creates the correct environment for your command to run from. Call this script then from cron. It shouldn't be necessary to specify the settings file for Pootle - it should automatically be detected.