Borgbackup: Difference between revisions

From David's Wiki
Created page with "[https://borgbackup.readthedocs.io/en/stable/ borgbackup] is a deduplicating backup software ==Installation== [https://borgbackup.readthedocs.io/en/stable/installation.html I..."
 
Line 42: Line 42:


===Pruning backups===
===Pruning backups===
If you're scripting daily, weekly, or monthly backups, you'll probably want to prune old backups.
[https://borgbackup.readthedocs.io/en/stable/usage/prune.html borg prune]
 
If you're scripting daily, weekly, or monthly backups, you'll probably want to prune old backups.
The command below will keep one backup from today, one backup from last week, and one backup from one month.
<pre>
borg prune --keep-daily 1 --keep-weekly 1 --keep-monthly 1 remote:~/my_backup
</pre>


==Resources==
==Resources==
* [https://practical-admin.com/blog/backups-using-borg/ practical-admin backups using borg]
* [https://practical-admin.com/blog/backups-using-borg/ practical-admin backups using borg]

Revision as of 01:53, 26 November 2020

borgbackup is a deduplicating backup software

Installation

Installation

sudo apt install borgbackup

If you want the latest version, you can download a static build from releases or use this backport repo.

Usage

quickstart

Create a repo

borg init

# Create a repo without encryption
borg init --encryption=none ./testrepo
# If you want encryption
#borg init --encryption=repokey ./testrepo

Create a backup

borg create

The following will create a backup of ~/src titled Monday to the repo ./testrepo.

borg create --stats ./testrepo::Monday ~/src
Notes
  • Name placeholders: {now}, {utcnow}, {fqdn}, {hostname}, {user}
Examples
borg create \
  --stats --show-rc \
  ./testrepo::'{hostname}-daily-{utcnow}' \
  /src

Pruning backups

borg prune

If you're scripting daily, weekly, or monthly backups, you'll probably want to prune old backups.
The command below will keep one backup from today, one backup from last week, and one backup from one month.

borg prune --keep-daily 1 --keep-weekly 1 --keep-monthly 1 remote:~/my_backup

Resources