X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=plc.d%2Fcrond;h=8ad9fddce34a7278a37b837706ed48e971b87447;hb=af4cf1475b4ddbff4659c6527c6dfd4a4f7649ef;hp=5fb41201305498f458265db8e3833738967c3b60;hpb=47ce654750c4d4ce9835dc88886a1384d9beaf2a;p=myplc.git diff --git a/plc.d/crond b/plc.d/crond index 5fb4120..8ad9fdd 100755 --- a/plc.d/crond +++ b/plc.d/crond @@ -7,13 +7,19 @@ # Mark Huang # Copyright (C) 2006 The Trustees of Princeton University # -# $Id: crond,v 1.2 2006/04/25 21:18:19 mlhuang Exp $ +# $Id: crond,v 1.7 2007/01/18 22:10:33 mlhuang Exp $ # # Source function library and configuration . /etc/plc.d/functions . /etc/planetlab/plc_config +# Be verbose +set -x + +# Export so that we do not have to specify -p to psql invocations +export PGPORT=$PLC_DB_PORT + case "$1" in start) MESSAGE=$"Starting crond" @@ -24,6 +30,7 @@ case "$1" in else MAILTO= fi + cat >/etc/cron.d/plc.cron <>/etc/cron.d/plc.cron + echo "*/15 * * * * root gen-sites-xml.py" >>/etc/cron.d/plc.cron + gen-slices-xml-05.py + check + gen-sites-xml.py + check + fi + + if [ "$PLC_WWW_ENABLED" = "1" ] ; then + echo "*/15 * * * * root gen-static-content.py" >>/etc/cron.d/plc.cron + echo "00 * * * * wget -O - -q http://localhost/cron.php" >>/etc/cron.d/plc.cron + gen-static-content.py + check + fi + + if [ "$PLC_DNS_ENABLED" = "1" ] ; then + echo "*/15 * * * * root dns-config" >>/etc/cron.d/plc.cron + dns-config + check + fi + + if [ "$PLC_DB_ENABLED" = "1" ] ; then + echo "5 5 * * * root vacuumdb -U postgres --all --analyze --quiet" >>/etc/cron.d/plc.cron + vacuumdb -U postgres --all --analyze --quiet + check + fi plc_daemon crond check