-
Notifications
You must be signed in to change notification settings - Fork 25
Crontab Setup
Dan Dyer edited this page Jun 23, 2013
·
3 revisions
To generate a page of news headlines on a fixed schedule, use cron.
First create a shell script to run Zeitgeist:
#!/bin/sh
cd /var/www/<web-root>
# You should store the Zeitgeist files and any configuration separately from the publicly accessible output.
# Use the nice command to lower the priority of the CPU-intensive Zeitgest Java process so that it does not
# interfere with other process running on the machine.
nice java -server -jar <path-to>/zeitgeist-publisher-1.2.jar <path-to>/[[zeitgeist.properties|Properties File]]
# Clean up old, unused image files.
find . -name \*.jpg -mtime +1 -exec rm -rf {} \;
Then add this script to your user's crontab (make sure that the user has read permissions for the Zeitgeist files and write permission for the output directory):
0,30 * * * * <path-to>/publish.sh &> /dev/null
This example will run Zeitgeist every 30 minutes (on the hour and at half-past).