manatee: Back up SQLite databases of DynamicUser services

/var/lib/<name> is a symlink into /var/lib/private for those, so find
stopped at the link and the state dump never copied their databases
(schema, puppy-tracker, todo, …). Follow it with find -H.
This commit is contained in:
Alexander Heldt committed 2026-10-04 16:36:33 +00:00
1 parent ab700c0368
commit 7a7499ba6d
1 file changed
+4 -1
+4 -1
View File
@@ -51,11 +51,14 @@ let
--exclude='__pycache__/' \ --exclude='__pycache__/' \
"$@" \ "$@" \
"$src/" "$dst/" "$src/" "$dst/"
# find -H: with DynamicUser, /var/lib/<name> is a symlink into
# /var/lib/private, and plain find stops at the link and finds no
# databases (rsync follows "$src/", but excludes them on purpose).
while IFS= read -r db; do while IFS= read -r db; do
local rel="''${db#"$src"/}" local rel="''${db#"$src"/}"
install -d -m700 "$dst/$(dirname "$rel")" install -d -m700 "$dst/$(dirname "$rel")"
sqlite3 "$db" ".backup '$dst/$rel'" sqlite3 "$db" ".backup '$dst/$rel'"
done < <(find "$src" -maxdepth 4 -type f \( -name '*.sqlite' -o -name '*.db' \)) done < <(find -H "$src" -maxdepth 4 -type f \( -name '*.sqlite' -o -name '*.db' \))
} }
# --- romm: logical MariaDB dump + user assets (saves/states/screenshots) --- # --- romm: logical MariaDB dump + user assets (saves/states/screenshots) ---