7 # Mark Huang <mlhuang@cs.princeton.edu>
8 # Copyright (C) 2006 The Trustees of Princeton University
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_WWW_ENABLED" = "1" ] ; then
46 echo "00 * * * * wget -O - -q http://localhost/cron.php" >>/etc/cron.d/plc.cron
47 wget -O - -q http://localhost/cron.php
51 if [ "$PLC_DNS_ENABLED" = "1" ] ; then
52 echo "*/15 * * * * root dns-config" >>/etc/cron.d/plc.cron
57 if [ "$PLC_DB_ENABLED" = "1" ] ; then
58 echo "5 5 * * * root vacuumdb -U postgres --all --analyze --quiet" >>/etc/cron.d/plc.cron
59 vacuumdb -U postgres --all --analyze --quiet
63 if [ "$PLC_WWW_ENABLED" = "1" ] ; then
64 echo "*/15 * * * * root clean-empty-dirs.py /var/tmp/bootmedium" >> /etc/cron.d/plc.cron
65 clean-empty-dirs.py /var/tmp/bootmedium
76 MESSAGE=$"Stopping crond"