====== Borg ====== Deduplicating archiver with compression and encryption [[https://www.borgbackup.org/|BorgBackup]] (short: Borg) gives you: * Space efficient storage of backups. * Secure, authenticated encryption. * Compression: LZ4, zlib, LZMA, zstd (since borg 1.1.4). * Mountable backups with FUSE. * Easy installation on multiple platforms: Linux, macOS, BSD, ... * Free software (BSD license). * Backed by a large and active open source community. ===== Packages ===== pacman -S borg python-llfuse ''borg'' package needs to be installed on the backup server and client. ''python-llfuse'' is for mounting a backup. Both [[https://github.com/python-llfuse/python-llfuse/#the-python-llfuse-module=|llfuse]] and [[https://github.com/libfuse/pyfuse3|pyfuse3]] are no longer maintained - as of 29.05.2022. ===== Backup ===== If you just want to get this done, go to our [[en:backup:server#borg|backup section]] which includes the borg script. Below you will find some command examples/information. ==== Create repo ==== borg init --encryption=keyfile-blake2 --make-parent-dirs borg/ ==== Create backup with encryption ==== borg create --stats --list --progress --verbose --filter AMEhsx --show-version --show-rc --exclude-caches --compression zstd,11 borg/::'{hostname}-{now}' .config/ --comment first_backup ==== Different encryption methods ==== === Key in repository, repokey encryption, BLAKE2b (often faster, since Borg 1.1) === The key will be placed in your backup repository. borg init --encryption=repokey-blake2 /path/to/repo === Local repository (no encryption) === borg init --encryption=none /path/to/repo === Keyfile === The key gets stored in your home dir - ''~/.config/borg/keys/''. borg init --encryption=keyfile user@hostname:backup ==== Remote / SSH including storage quota ==== borg init --encryption=keyfile-blake2 --storage-quota (e.g. 5G, 1.5T) --make-parent-dirs ssh://username@remote.host.address:$port/~/borg ==== List / Mount / umount backup ==== borg list /path mkdir /path/mount/ borg mount .::Tuesday /path/mount/ borg mount repo/ /path/mount/ borg umount .::Tuesday /path/mount/ borg umount repo/ /path/mount/ The path must be writable for borg! A path created in the home folder means that the mount folder must be writable for the home user. ==== Difference between two backups ==== borg diff repo/::archive-2022-02-14T23:18:18 archive-2022-02-14T23:26:10 ==== Delete ==== If you want to delete your backup for good, run the command without ''%%--%%dry-run''. borg delete --dry-run --stats repo/ borg delete --dry-run --stats repo/::archive-2022-02-14T23:26:10 ==== Info ==== borg info repo/ borg info repo/::archive-2022-02-14T23:26:10 ==== Restore/extract ==== If you want to restore, run the command without ''%%--dry-run%%''. borg extract --dry-run repo/::archive-2022-02-14T23:26:10 ==== Check/verify data ==== borg check repo/ borg check repo/::archive-2022-02-14T23:26:10 borg check --verify-data repo/ borg check --verify-data repo/::archive-2022-02-14T23:26:10 ==== Borg website ==== More information can also be found on [[https://borgbackup.readthedocs.io/en/stable/usage/general.html|borgs website]] as well.