From 3f385e6835d5f10e386116f69b58a9a3dedf3f90 Mon Sep 17 00:00:00 2001 From: downtownallday Date: Sat, 22 Mar 2025 18:37:46 -0400 Subject: [PATCH] vacuum only if non-empty the file may have already been created by the management daemon --- setup/management-capture.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup/management-capture.sh b/setup/management-capture.sh index 8eafaf92..9a4beb31 100755 --- a/setup/management-capture.sh +++ b/setup/management-capture.sh @@ -41,7 +41,8 @@ sed "s|%BIN%|$(pwd)|g" conf/miabldap-capture.service > /etc/systemd/system/miabl 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" hide_output systemctl stop miabldap-capture hide_output /usr/bin/sqlite3 "$db" "VACUUM;"