diff --git a/README.md b/README.md index 82a1a99..e309610 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,27 @@ -# database-backup +# Database Backup -Docker container able to do a backup from databases through network access \ No newline at end of file +Periodically do a backup of a database + +This app uses [Ofelia](https://hub.docker.com/r/mcuadros/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)