1 4.4 Configuration examples
Asif Bacchus edited this page 2 years ago

configuration examples

Here are a few examples on how to set-up the details file in case things are still not clear.

scenario 1 Using custom borg base-dir, sshprivate.key to connect to your provider and your remote repo is named mailcowBackup. Your repo requires both a password and a key. Your key is stored in a custom location. You have a list of both inclusions and exclusions for additional files to backup and you'd like to keep all backups within the last 14 days. Your remote server also runs borg. In this scenario, you are using every possible configuration option.

borgBaseDir="/var/borgbackup"
borgSSHKey="/var/borgbackup/sshprivate.key"
borgConnectRepo="janedoe@borg.provider.net:mailcowBackup/"
borgRepoPassphrase="p@ssW0rd_"
borgKeyfileLocation="/root/keys/mailcowBackup.key"
borgXtraListPath="/root/mailcowXtraFiles.borg"
borgExcludeListPath="/root/mailcowExclusions.borg"
borgPruneSettings="--keep-within=14d"
borgRemote="borg1"

scenario 2 Using custom borg base-dir, private.key to connect to your provider, remote repo named emailBackup. Your repo requires a key but it's either a repokey-style repo (key stored within the repo) or your key is located in the default location within the base-dir. You have a list of addtional files to backup and no exclusions. You wish to keep end of day backups for the last 7 days and 16 weeks thereafter. Your provider also runs borg.

option 1: omit key file location, forces borg to use default

borgBaseDir="/var/borgbackup"
borgSSHKey="/var/borgbackup/private.key"
borgConnectRepo="janedoe@borg.provider.net:emailBackup/"
borgRepoPassphrase="p@ssW0rd_"
#borgKeyfileLocation=
borgXtraListPath="/root/mailcowXtraFiles.borg"
#borgExcludeListPath=
borgPruneSettings="--keep-daily=7d --keep-weekly=16"
borgRemote="borg1"

option 2: provide the default location within the base-dir just to be explicit or to specify a particular key

borgBaseDir="/var/borgbackup"
borgSSHKey="/var/borgbackup/private.key"
borgConnectRepo="janedoe@borg.provider.net:emailBackup/"
borgRepoPassphrase="p@ssW0rd_"
borgKeyfileLocation="/var/borgbackup/.config/keys/borg_provider_net__emailBackup"
borgXtraListPath="/root/mailcowXtraFiles.borg"
#borgExcludeListPath=
borgPruneSettings="--keep-daily=7d --keep-weekly=16"
borgRemote="borg1"

scenario 3 Running borg as root and using default base-dir (home directory), private.key to connect to your provider and remote repo named email. You repo is password protected and repo-key style (no keyfile required). You have no additional files to backup and no exclusions. You want to keep all backups made in the last 7 days and then 30 days end-of-day thereafter. Your provider sadly does not run borg.

borgBaseDir="/root"
borgSSHKey="/root/private.key"
borgConnectRepo="janedoe@borg.provider.net:email/"
borgRepoPassphrase="p@ssW0rd_"
#borgKeyfileLocation=
#borgXtraListPath=
#borgExcludeListPath=
borgPruneSettings="--keep-within=7d --keep-daily=30"
#borgRemote=

If you need help figuring out particular settings to make your backups work, drop me a line in the issues.