backup-now script overwrites previous instances when multiple DBs configured #476
androidfans
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Description
In
create_schedulers()atinstall/assets/functions/10-db-backup, the fix for the>>append bug (which caused duplicate backup entries on container restart) replaced>>with>for writing/usr/bin/backup-now:This means when multiple DB instances are configured (e.g. DB01, DB02), each loop iteration overwrites the previous content. Only the last instance ends up in
backup-now, sobackup-nowonly triggers the last configured database backup.The same issue exists for the individual
backup${instance}-nowscripts a few lines above:cat <<EOF > /usr/bin/backup"${instance}"-nowExpected behavior
Running
backup-nowshould trigger backups for all configured DB instances (DB01, DB02, etc.).Suggested fix
Initialize the file with
>once before the loop (or truncate it), then use>>inside the loop:This avoids both the original append-on-restart bug and the current overwrite bug.
Version
4.1.100 (also present in 4.1.99, carried over from tiredofit/docker-db-backup)
Beta Was this translation helpful? Give feedback.
All reactions