A Bash script version backup dumps of a database in a docker container managed by Docker Compose
Find a file
2022-06-09 07:21:28 +00:00
.gitignore updated script to work in new location closer to Mastodon code 2019-10-10 02:57:41 +00:00
dbbackup-cron updated script to work in new location closer to Mastodon code 2019-10-10 02:57:41 +00:00
dbbackup-docker-compose updated script to work in new location closer to Mastodon code 2019-10-10 02:57:41 +00:00
default-docker-compose.conf-sample removing default-docker-compose.conf to avoid merge issues on other installs 2018-02-09 16:32:54 +13:00
default-mariadb-docker-compose.conf initial commit of containerised MariaDB backup functionality 2022-06-09 15:26:20 +12:00
LICENSE Initial commit 2018-02-08 03:44:40 +00:00
mariadbbackup-docker-compose initial commit of containerised MariaDB backup functionality 2022-06-09 15:26:20 +12:00
pgdbbackup initial commit of containerised MariaDB backup functionality 2022-06-09 15:26:20 +12:00
README.md Update README.md 2022-06-09 07:21:28 +00:00

The purpose of this script is to backup the contents of Docker container-based database (either PostgreSQL or MariaDB) to a local 'dump' file (SQL format), which is then compressed to conserve disk space.

The system is designed to be run regularly (perhaps hourly, or daily) via cron, and to keep a pre-determined (via configuration) number of past, deleting excess backup files to conserve disk space.

To install

To install this script, by our convention on Docker Compose hosts, we clone it into /home/data/scripts (creating the directory if necessary), via git clone git@git.oeru.org:oeru/docker-compose-dbbackup.git.

Then, in that directory, we copy the relevant '*.conf-sample' configuration file and copy it to a '*.conf' file and adjust its values. You can try running the backup to test it by running (for example)

./mariadbbackup-docker-compose --hourly

which should, if the configuration is valid, create an hourly database backup (starting with the database name with '-hourly' affixed, e.g. )