MAN page from OpenSuSE borgmatic-1.0.3hg.135-1.1.noarch.rpm
borgmatic - Automation tool for borgbackup
borgmatic (formerly atticmatic) is a simple Python wrapper script forthe Borg (https://borgbackup.readthedocs.org/en/stable/) backup softwarethat initiates a backup, prunes any old backups according to a retentionpolicy, and validates backups for consistency.The script supports specifying your settings in a declarativeconfiguration file rather than having to put them all on thecommand-line, and handles common errors.
You can run borgmatic and start a backup simply by invoking it withoutarguments.This will also prune any old backups as per the configured retentionpolicy, and check backups for consistency problems due to things likefile damage.
By default, the backup will proceed silently except in the case oferrors.But if you[aq]d like to to get additional information about theprogress of the backup as it proceeds, use the verbosity option:
C]borgmatic --verbosity 1]
Or, for even more progress spew:
C]borgmatic --verbosity 2]
If you[aq]d like to see the available command-line arguments, view thehelp:
Here[aq]s an example config file:
C][location]# Space-separated list of source directories to backup.# Globs are expanded.source_directories: /home /etc /var/log/syslog*# Path to local or remote backup repository.repository: userAATTbackupserver:sourcehostname.borg[retention]# Retention policy for how many backups to keep in each category.keep_daily: 7keep_weekly: 4keep_monthly: 6[consistency]# Consistency checks to run, or "disabled" to prevent checks.checks: repository archives]
Additionally, exclude patterns can be specified in a separate excludesconfig file, one pattern per line.
borgmatic is hosted at <https://torsion.org/borgmatic> with source codeavailable (https://torsion.org/hg/borgmatic).It[aq]s also mirrored on GitHub (https://github.com/witten/borgmatic)and BitBucket (https://bitbucket.org/dhelfman/borgmatic) forconvenience.
To get up and running, follow the Borg QuickStart (https://borgbackup.readthedocs.org/en/latest/quickstart.html) tocreate a repository on a local or remote host.Note that if you plan to run borgmatic on a schedule with cron, and youencrypt your Borg repository with a passphrase instead of a key file,you[aq]ll need to set the borgmatic C]encryption_passphrase]configuration variable.See the repository encryption section of the Quick Start for more info.
If the repository is on a remote host, make sure that your local rootuser has key-based ssh access to the desired user account on the remotehost.
You can find example configuration files to run borgmatic automaticallyfrom cron or systemd at /usr/share/doc/packages/borgmatic/sample/cronand /usr/share/doc/packages/borgmatic/sample/systemd.
Lastly, modify the /etc/borgmatic files with your desired configuration.
Upgrading from atticmatic
borgmatic only supports Borg now and no longer supports Attic.So if you[aq]re an Attic user, consider switching to Borg.See the Borg upgradecommand (https://borgbackup.readthedocs.io/en/stable/usage.html#borg-upgrade)for more information.Then, follow the instructions above about setting up your borgmaticconfiguration files.
If you want to run borgmatic automatically, say once a day, the you canconfigure a job runner to invoke it periodically.
If you[aq]re using systemd instead of cron to run jobs, the servicefiles are already installed and all you have to do is enable and startthe borgmatic service:
C]sudo systemctl enable borgmatic.timersudo systemctl start borgmatic.timer]
Feel free to modify the timer file based on how frequently you[aq]dlike borgmatic to run.
If you prefer to use cron, copy the sample file to the cron directory:
C]sudo cp /usr/share/doc/packages/borgmatic/sample/cron /etc/cron.d/borgmatic]
You can modify the cron file if you[aq]d like to run borgmatic more orless frequently.
Broken pipe with remote repository
When running borgmatic on a large remote repository, you may receiveerrors like the following, particularly while "borg check" is validatingbackups for consistency:
C]Write failed: Broken pipeborg: Error: Connection closed by remote host]
This error can be caused by an ssh timeout, which you can rectify byadding the following to the ~/.ssh/config file on the client:
C]Host * ServerAliveInterval 120]
This should make the client keep the connection alive while validatingbackups.
Issues and feedback
Got an issue or an idea for a feature enhancement?Check out the borgmatic issuetracker (https://tree.taiga.io/project/witten-borgmatic/issues?page=1&status=399951,399952,399955).In order to create a new issue or comment on an issue, you[aq]ll needto login first (https://tree.taiga.io/login).
Other questions or comments?Contact mailto:firstname.lastname@example.org (mailto:wittenAATTtorsion.org).
- Upgrading from atticmatic
- Broken pipe with remote repository
- Issues and feedback
This document was created byman2html,using the manual pages.