Skip to content

update Backup script for mysql - #27

Open
sseide wants to merge 1 commit into
jchonig:backupfrom
sseide:backup
Open

update Backup script for mysql#27
sseide wants to merge 1 commit into
jchonig:backupfrom
sseide:backup

Conversation

@sseide

@sseide sseide commented May 14, 2024

Copy link
Copy Markdown
Contributor
  • 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_filename holds the file name only without path - but in the script you are using /backup/${backup_filename} everywhere except within the trap command. 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 $tmpfile

  • running 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-dump default 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 $prgname is 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"?

@sseide
sseide changed the base branch from master to backup May 14, 2024 07:15
@jchonig
jchonig force-pushed the backup branch 6 times, most recently from 1b15da0 to 4bb5434 Compare May 17, 2024 01:45
@jchonig
jchonig force-pushed the backup branch 2 times, most recently from 85cf87f to 6ff1a3e Compare August 26, 2024 12:46
@jchonig
jchonig force-pushed the backup branch 7 times, most recently from 5e838bd to 6ea9461 Compare September 15, 2024 01:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant