update Backup script for mysql - #27
Open
sseide wants to merge 1 commit into
Open
Conversation
jchonig
force-pushed
the
backup
branch
6 times, most recently
from
May 17, 2024 01:45
1b15da0 to
4bb5434
Compare
jchonig
force-pushed
the
backup
branch
2 times, most recently
from
August 26, 2024 12:46
85cf87f to
6ff1a3e
Compare
jchonig
force-pushed
the
backup
branch
7 times, most recently
from
September 15, 2024 01:38
5e838bd to
6ea9461
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Url parsing is a bit unreliable - especially as one might (need) to set some extra config parameters via connection url like
mysql://server:3306/mmonit?serverTimezone=UTC&...(https://mmonit.com/wiki/MMonit/Setup#database -> database url format)
For cli exists a little tool from the author of cURL that is available as OS packages starting with Alpine 3.19 / Debian 13 Trixie:
https://pkgs.alpinelinux.org/packages?name=trurl&branch=v3.19&repo=&arch=&maintainer=
https://daniel.haxx.se/blog/2023/04/03/introducing-trurl/
unfortunately it is not part of Alpine 3.18
the script cd'sinto the /config folder. The env var
backup_filenameholds the file name only without path - but in the script you are using/backup/${backup_filename}everywhere except within thetrapcommand. I'm not sure, but it wont delete the file as it is in the wrong directory? Therefor changed var definition to be a full path similar to the$tmpfilerunning Mariadb backup with user password set as command line parameter might be insecure as it is visible to others, created Mariadb config file instead with all relevant parameter and just pass this as
mariadb-dumpdefault config (instead of ignoring all config files)Mariadb can be accessed via (bind mounted) Unix socket too - parsed this too if set and added to backup config file (https://github.com/joealcorn/mmonit/blob/b3e72f99d20273699ed433d14e9dbdbabd441c61/templates/etc/mmonit/server.xml#L182)
on creating
$tmpfile- the env var$prgnameis not defined - or does it come somewhere from s6-overlay? (line 82)i'm not sure if its good to backup all databases here. On a shared MariaDB server the MMonit user has (or should have) access to its own database only. Shall the backup program run for the mmonit database only? Or "--all-databases"?