mirror of
https://github.com/mail-in-a-box/mailinabox.git
synced 2025-07-07 23:50:55 +00:00
during setup, vacuum the reporting/capture database
This commit is contained in:
parent
8fa2e4759c
commit
a90d646673
@ -15,6 +15,9 @@ source /etc/mailinabox.conf # load global vars
|
|||||||
echo "Installing miabldap-capture daemon..."
|
echo "Installing miabldap-capture daemon..."
|
||||||
|
|
||||||
conf="$STORAGE_ROOT/reporting/config.json"
|
conf="$STORAGE_ROOT/reporting/config.json"
|
||||||
|
db="$STORAGE_ROOT/reporting/capture.sqlite"
|
||||||
|
|
||||||
|
apt_install sqlite3
|
||||||
|
|
||||||
if [ ! -e "$conf" ]; then
|
if [ ! -e "$conf" ]; then
|
||||||
mkdir -p $(dirname "$conf")
|
mkdir -p $(dirname "$conf")
|
||||||
@ -37,5 +40,11 @@ fi
|
|||||||
sed "s|%BIN%|$(pwd)|g" conf/miabldap-capture.service > /etc/systemd/system/miabldap-capture.service
|
sed "s|%BIN%|$(pwd)|g" conf/miabldap-capture.service > /etc/systemd/system/miabldap-capture.service
|
||||||
|
|
||||||
hide_output systemctl daemon-reload
|
hide_output systemctl daemon-reload
|
||||||
|
|
||||||
|
if [ -e "$db" ]; then
|
||||||
|
echo "Vacuum capture database"
|
||||||
|
hide_output systemctl stop miabldap-capture
|
||||||
|
hide_output /usr/bin/sqlite3 "$db" "VACUUM;"
|
||||||
|
fi
|
||||||
hide_output systemctl enable miabldap-capture
|
hide_output systemctl enable miabldap-capture
|
||||||
restart_service miabldap-capture
|
restart_service miabldap-capture
|
||||||
|
Loading…
Reference in New Issue
Block a user