From 725558b1dbbe7050613a4a39c3db9986c2e9d1ec Mon Sep 17 00:00:00 2001 From: Luke Murphy Date: Tue, 22 Sep 2020 10:52:39 +0200 Subject: [PATCH] Add borgmatic example --- README.md | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/README.md b/README.md index a1367e6..333be5a 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,8 @@ If you push a commit to master, the [Drone config](./.drone.yml) will publish to ## Usage +### compose.yml + ```yaml backupbot: image: "decentral1se/backup-bot:0.0.1" @@ -39,3 +41,44 @@ backupbot: restart_policy: condition: none ``` + +### borgmatic.yml + +```yaml +location: + source_directories: + - /var/www/html/wp-content + repositories: + - {{ env "BORGBASE_REPO" }} + +storage: + compression: auto,zstd + encryption_passphrase: {{ secret "backup_bot_password" }} + archive_name_format: "{hostname}-{now}" + ssh_command: "ssh -o 'StrictHostKeyChecking no' -i /run/secrets/backup_bot_ssh_key" + +retention: + keep_daily: 3 + keep_weekly: 4 + keep_monthly: 12 + keep_yearly: 2 + prefix: "{hostname}-" + +consistency: + checks: + - disabled + check_last: 3 + prefix: "{hostname}-" + +hooks: + before_backup: + - echo "`date` - Starting backup" + after_backup: + - echo "`date` - Finished backup" + mysql_databases: + - name: {{ env "DB_TABLE" }} + hostname: {{ env "DB_HOST" }} + port: 3306 + username: {{ env "DB_USER" }} + password: {{ secret "db_password" }} +```