diff options
Diffstat (limited to 'script/compact-xapian-database')
-rwxr-xr-x | script/compact-xapian-database | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/script/compact-xapian-database b/script/compact-xapian-database index 7d32d7a15..cb2d578e6 100755 --- a/script/compact-xapian-database +++ b/script/compact-xapian-database @@ -15,15 +15,12 @@ if [ -x /usr/bin/xapian-compact ]; echo >&2 "Didn't compact Xapian database because there was an existing database at $XAPIAN_DB_DIR/$RAILS_ENV.new" exit 1 else - OWNER=$(stat -c %U "$XAPIAN_DB_DIR/$RAILS_ENV") export XAPIAN_DB_DIR RAILS_ENV - su "$OWNER" <<SU -commonlib/bin/output-on-error xapian-compact "\$XAPIAN_DB_DIR/\$RAILS_ENV" "\$XAPIAN_DB_DIR/\$RAILS_ENV.new" -SU + commonlib/bin/output-on-error xapian-compact "$XAPIAN_DB_DIR/$RAILS_ENV" "$XAPIAN_DB_DIR/$RAILS_ENV.new" 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 "$DAEMON_NAME" restart + commonlib/bin/output-on-error /usr/sbin/service "$DAEMON_NAME" restart fi else echo >&2 "Could not find xapian-compact script; have you installed xapian-tools?" |