2024-10-22 10:50:02 -03:00
2024-10-22 11:56:53 -03:00
2024-10-15 19:20:09 +00:00
2024-10-17 19:37:58 -03:00

Database Backup

Periodically do a backup of a database

This app uses Ofelia to schedule a backup routine which may store one or more databases according to configuration.

Configuration

Setup is made populating the BACKUP_DATABASES environment variable with a list of backup configuration. Each backup setup must be in a single line and have two items: a database URL and a cron-like string indicating the periodicity of the backup.

Examples

All examples listed refer to the (hipotetical) mysql server mydatabase.com.br logged with the username db_user:

  • schema: mysql (at this moment is the only database supported)
  • username: db_user
  • host: mydatabase.com.br

mysql://db_user:123456@mydatabase.com.br:3306/database-to-backup @hourly

  • password: 123456 (login will be attempted with this password)
  • port: 3306 (as it is the default port for mysql it could be ommited)
  • database: database-to-backup (only this database are going to be backuped and ommiting this value will vary depending on the database, generaly meaning backuping all accessible databases)
  • schedule: @hourly (each 60 minutes, with the first occurence 60 minutes after starting the system) mysql://db_user:123456@mydatabase.com.br 0 0 1 * * *
  • password: 123456 (login will be attempted with this password)
  • schedule: 0 0 1 * * * (in (GO implementation cron format)[https://godoc.org/github.com/robfig/cron])meaning on this case every night at 01h00) mysql://db_user@mydatabase.com.br/* @daily
  • schedule: @daily (onde a day starting 24h from starting)
Description
Periodically do a backup of a database
Readme 73 KiB
Languages
Shell 97.2%
Dockerfile 2.8%