Jack Moore

Email: jack(at)jmoore53.com
Project Updates

Regular Database Backups for Kanboard

26 May 2023 » code, infrastructure, docker

Luckily it was just Kanboard, but unfortunately I lost mountains of tasks and data. This forced me to look into backups more seriously. Below is my backup script and crontab configuration.

Script to backup kanboard configuration:

docker exec kanboard-db-1 /usr/bin/mysqldump -u kb --password=kb-secret kanboard > /srv/data/opt/kanboard/backups/backup-$(date '+%Y-%m-%d').sql

# Backup
#docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql

# Restore
#cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
#cat backup-2023-05-26.sql | docker exec -i kanboard-db-1 /usr/bin/mysql -u root --password=secret kanboard

Crontab:

0 4 * * * /srv/data/opt/kanboard/kb-mysqldump.sh
© Jack Moore - This site was last built Fri 30 Aug 2024 12:31:24 PM EDT