1
0
mirror of https://github.com/mail-in-a-box/mailinabox.git synced 2025-07-07 23:50:55 +00:00

vacuum only if non-empty

the file may have already been created by the management daemon
This commit is contained in:
downtownallday 2025-03-22 18:37:46 -04:00
parent a90d646673
commit 3f385e6835

View File

@ -41,7 +41,8 @@ sed "s|%BIN%|$(pwd)|g" conf/miabldap-capture.service > /etc/systemd/system/miabl
hide_output systemctl daemon-reload hide_output systemctl daemon-reload
if [ -e "$db" ]; then # vacuum database if it exists and is non-empty
if [ -s "$db" ]; then
echo "Vacuum capture database" echo "Vacuum capture database"
hide_output systemctl stop miabldap-capture hide_output systemctl stop miabldap-capture
hide_output /usr/bin/sqlite3 "$db" "VACUUM;" hide_output /usr/bin/sqlite3 "$db" "VACUUM;"