7 # Mark Huang <mlhuang@cs.princeton.edu>
8 # Copyright (C) 2006 The Trustees of Princeton University
10 # $Id: crond,v 1.9 2007/02/07 23:21:27 mlhuang Exp $
13 # Source function library and configuration
14 . /etc/plc.d/functions
15 . /etc/planetlab/plc_config
20 # Export so that we do not have to specify -p to psql invocations
21 export PGPORT=$PLC_DB_PORT
25 MESSAGE=$"Starting crond"
28 if [ "$PLC_MAIL_ENABLED" = "1" ] ; then
29 MAILTO=$PLC_MAIL_SUPPORT_ADDRESS
34 cat >/etc/cron.d/plc.cron <<EOF
36 PATH=/sbin:/bin:/usr/sbin:/usr/bin
40 # minute hour day-of-month month day-of-week user command
43 # Run all jobs once at startup
45 if [ "$PLC_BOOT_ENABLED" = "1" ] ; then
46 echo "*/5 * * * * root gen-slices-xml-05.py" >>/etc/cron.d/plc.cron
51 if [ "$PLC_WWW_ENABLED" = "1" ] ; then
52 echo "*/15 * * * * root gen-static-content.py" >>/etc/cron.d/plc.cron
53 echo "*/15 * * * * root gen-sites-xml.py" >>/etc/cron.d/plc.cron
54 echo "00 * * * * wget -O - -q http://localhost/cron.php" >>/etc/cron.d/plc.cron
59 wget -O - -q http://localhost/cron.php
63 if [ "$PLC_DNS_ENABLED" = "1" ] ; then
64 echo "*/15 * * * * root dns-config" >>/etc/cron.d/plc.cron
69 if [ "$PLC_DB_ENABLED" = "1" ] ; then
70 echo "5 5 * * * root vacuumdb -U postgres --all --analyze --quiet" >>/etc/cron.d/plc.cron
71 vacuumdb -U postgres --all --analyze --quiet
82 MESSAGE=$"Stopping crond"