Borg

Description

Deduplicating archiver with compression and encryption


Installation

$apt install borgbackup

Usage

Init a backup

$borg init --encryption=repokey-blake2 /mnt/backup

Create first backup

$borg create -v -s -p --stats /mnt/backup::"name of backup" ~/documents_to_save

Next backup

$borg create -v -s -p --stats /mnt/backup::"name of backup" ~/documents_to_save

List backups

$borg list /mnt/backup

List content of backup

$borg list /mnt/backup::"name of backup"

Restore backup

$cd /your_directory_you_want
$borg extract /mnt/backup::"name of backup"

Prune

in this example : keep backups of 2 per days, 2 per weeks, 1 per month, 1 per year.

$borg prune -v -s --keep-within=2d --keep-weekly=2 --keep-monthly=-1 --keep-yearly=-1 /mnt/backup

Delete backup and free space

$borg delete /mnt/backup::"name of backup"

Check archive

$borg check -v /mnt/backup

Check and repair

$borg check -v --repair /mnt/backup

Source : official doc

Date : 2017.12.12