diff options
-rw-r--r-- | config/crontab-example | 2 | ||||
-rwxr-xr-x | script/compact-xapian-database | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/config/crontab-example b/config/crontab-example index ff1a83d10..f65555b11 100644 --- a/config/crontab-example +++ b/config/crontab-example @@ -21,7 +21,7 @@ MAILTO=!!(*= $mailto *)!! 31 * * * * root !!(*= $vhost_dir *)!!/!!(*= $vcspath *)!!/commonlib/bin/run-with-lockfile.sh -n !!(*= $vhost_dir *)!!/load-mail-server-logs.lock !!(*= $vhost_dir *)!!/!!(*= $vcspath *)!!/script/load-mail-server-logs || echo "stalled?" # Once a day, early morning -31 1 * * * !!(*= $user *)!! !!(*= $vhost_dir *)!!/!!(*= $vcspath *)!!/commonlib/bin/run-with-lockfile.sh -n !!(*= $vhost_dir *)!!/change-xapian-database.lock "!!(*= $vhost_dir *)!!/!!(*= $vcspath *)!!/script/compact-xapian-database production || echo "stalled?" +31 1 * * * !!(*= $user *)!! !!(*= $vhost_dir *)!!/!!(*= $vcspath *)!!/commonlib/bin/run-with-lockfile.sh -n !!(*= $vhost_dir *)!!/change-xapian-database.lock "!!(*= $vhost_dir *)!!/!!(*= $vcspath *)!!/script/compact-xapian-database production !!(*= $site *)!!" || echo "stalled?" 23 4 * * * !!(*= $user *)!! !!(*= $vhost_dir *)!!/!!(*= $vcspath *)!!/commonlib/bin/run-with-lockfile.sh -n !!(*= $vhost_dir *)!!/delete-old-things.lock !!(*= $vhost_dir *)!!/!!(*= $vcspath *)!!/script/delete-old-things || echo "stalled?" 0 6 * * * !!(*= $user *)!! !!(*= $vhost_dir *)!!/!!(*= $vcspath *)!!/commonlib/bin/run-with-lockfile.sh -n !!(*= $vhost_dir *)!!/alert-overdue-requests.lock !!(*= $vhost_dir *)!!/!!(*= $vcspath *)!!/script/alert-overdue-requests || echo "stalled?" 0 7 * * * !!(*= $user *)!! !!(*= $vhost_dir *)!!/!!(*= $vcspath *)!!/commonlib/bin/run-with-lockfile.sh -n !!(*= $vhost_dir *)!!/alert-new-response-reminders.lock !!(*= $vhost_dir *)!!/!!(*= $vcspath *)!!/script/alert-new-response-reminders || echo "stalled?" diff --git a/script/compact-xapian-database b/script/compact-xapian-database index 02014c92c..7d32d7a15 100755 --- a/script/compact-xapian-database +++ b/script/compact-xapian-database @@ -1,6 +1,7 @@ #!/bin/bash export RAILS_ENV=$1 +if [ -z $2 ]; then DAEMON_NAME=alaveteli; else DAEMON_NAME=$2; fi set -e cd "$(dirname "$0")"/.. @@ -22,7 +23,7 @@ SU mv "$XAPIAN_DB_DIR/$RAILS_ENV" "$XAPIAN_DB_DIR/$RAILS_ENV.tmp" mv "$XAPIAN_DB_DIR/$RAILS_ENV.new" "$XAPIAN_DB_DIR/$RAILS_ENV" rm -rf "$XAPIAN_DB_DIR/$RAILS_ENV.tmp" - commonlib/bin/output-on-error service alaveteli restart + commonlib/bin/output-on-error service "$DAEMON_NAME" restart fi else echo >&2 "Could not find xapian-compact script; have you installed xapian-tools?" |