7 # Mark Huang <mlhuang@cs.princeton.edu>
8 # Copyright (C) 2006 The Trustees of Princeton University
10 # $Id: crond,v 1.8 2007/01/26 05:54:35 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
53 if [ "$PLC_WWW_ENABLED" = "1" ] ; then
54 echo "*/15 * * * * root gen-static-content.py" >>/etc/cron.d/plc.cron
55 echo "*/15 * * * * root gen-sites-xml.py" >>/etc/cron.d/plc.cron
56 echo "00 * * * * wget -O - -q http://localhost/cron.php" >>/etc/cron.d/plc.cron
61 if [ "$PLC_DNS_ENABLED" = "1" ] ; then
62 echo "*/15 * * * * root dns-config" >>/etc/cron.d/plc.cron
67 if [ "$PLC_DB_ENABLED" = "1" ] ; then
68 echo "5 5 * * * root vacuumdb -U postgres --all --analyze --quiet" >>/etc/cron.d/plc.cron
69 vacuumdb -U postgres --all --analyze --quiet
80 MESSAGE=$"Stopping crond"