jchonig / docker-mmonit

A container to run M/Monit
Creative Commons Zero v1.0 Universal
10 stars 4 forks source link

Add support for backing up mysql database #26

Open jchonig opened 4 months ago

jchonig commented 4 months ago

Code that works with mysql is on this branch: https://github.com/jchonig/docker-mmonit/tree/backup. It is also built on docker hub with tag backup-4.2.2

It needs testing on sqlite3 to ensure it still works.

@sseide do you use the backup functionality?

sseide commented 4 months ago

Currently i am using external backup for my mysql data. But i can try your solution later this week.

sseide commented 4 months ago

hi - looking at the script i found some issues and things to impprove. I created an PR with the updates. Feel free to either accept or cherry-pick from it (#27).

jchonig commented 4 months ago

@sseide lots of good stuff in there.

I upgraded the branch to 3.19 and will integrate and test your changes there.

Would someone actually access mysql via a socket from within a container?

sseide commented 4 months ago

Would someone actually access mysql via a socket from within a container?

At least i do :-) Having one central database to tune and take care of, running locally on docker host. This has no other network connection. Only socket is mounted into all containers needing a database.

Every docker container bringing its own DBMS nowadays is to much work to tune and secure everything. Every db needs its own backup setup and software updates to watch and apply... much easier having one system only to focus on.

jchonig commented 4 months ago

@sseide I refactored the changes init initialization, which run in the s6 service init-mmont and the actual backup in /etc/periodic/hourly/mmonit_backup.

I think I have all your changes included. Could you please take a look.

Thanks

Jeff