IT/Software/Backup Programs/Borg Backup: Difference between revisions
No edit summary |
No edit summary |
||
Line 7: | Line 7: | ||
===Usage=== | ===Usage=== | ||
===Repos=== | |||
A Borg repo is where backup data is stored. | A Borg repo is where backup data is stored. | ||
Line 18: | Line 18: | ||
<br /> | <br /> | ||
===Creating a backup=== | |||
When creating a backup we need to specify what kind of compression we want to use, where the repo we want to backup to is, and where the source files we want to backup are located. | When creating a backup we need to specify what kind of compression we want to use, where the repo we want to backup to is, and where the source files we want to backup are located. | ||
borg create -C auto,lzma --progress ''repo/location''/::''name-of-backup'' ''location/to/be/backed/up'' | borg create -C auto,lzma --progress ''repo/location''/::''name-of-backup'' ''location/to/be/backed/up'' | ||
Line 26: | Line 26: | ||
... ''repo/location''/::`date '+%Y-%m-%d-%H.%M.%S'` ''location/to/be/backed/up'' | ... ''repo/location''/::`date '+%Y-%m-%d-%H.%M.%S'` ''location/to/be/backed/up'' | ||
====Backing up over SSH==== | |||
In all Borg commands we can use ssh://ip.of.server/repo/location/on/server. | In all Borg commands we can use ssh://ip.of.server/repo/location/on/server. | ||
borg create -C auto,lzma --progress <nowiki>ssh://my.backup.server/</nowiki>''repo/location''/::''name-of-backup'' ''location/to/be/backed/up'' | borg create -C auto,lzma --progress <nowiki>ssh://my.backup.server/</nowiki>''repo/location''/::''name-of-backup'' ''location/to/be/backed/up'' | ||
<br /> | <br /> | ||
===Viewing a repos backups=== | |||
To list all the backups in a repo we can run the following: | To list all the backups in a repo we can run the following: | ||
borg list ''/path/to/repo'' | borg list ''/path/to/repo'' | ||
Line 37: | Line 37: | ||
<br /> | <br /> | ||
===Restoring from a backup=== | |||
We can mount a Borg backup as if it was a regular drive anywhere in the filesystem. | |||
borg mount ''/path/to/repo/''::''backupName mountPoint/'' | |||
[[File:Borg Mount.jpg|frameless|496x496px]] | |||
We can pull files from the backup as if it were a regular drive. | |||
To unmount the backup we can run: | |||
umount ''mountpoint''/ | |||
dfgsdfgsd |
Revision as of 19:50, 4 December 2020
About
Borg Backup is a backup program that features compression deduplication, data compression and runs nicely over SSH.
Usage
Repos
A Borg repo is where backup data is stored.
A repo can be created by running the following in an empty directory.
borg init -e none repoLocation
"-e none" is a required flag to tell bog that we don't want any encryption.
Creating a backup
When creating a backup we need to specify what kind of compression we want to use, where the repo we want to backup to is, and where the source files we want to backup are located.
borg create -C auto,lzma --progress repo/location/::name-of-backup location/to/be/backed/up
LZMA compression uses more CPU and less storage space.
Name of backup must be unique so using the date command instead of a static name is desirable when automating backups.
... repo/location/::`date '+%Y-%m-%d-%H.%M.%S'` location/to/be/backed/up
Backing up over SSH
In all Borg commands we can use ssh://ip.of.server/repo/location/on/server.
borg create -C auto,lzma --progress ssh://my.backup.server/repo/location/::name-of-backup location/to/be/backed/up
Viewing a repos backups
To list all the backups in a repo we can run the following:
borg list /path/to/repo
Restoring from a backup
We can mount a Borg backup as if it was a regular drive anywhere in the filesystem.
borg mount /path/to/repo/::backupName mountPoint/
We can pull files from the backup as if it were a regular drive.
To unmount the backup we can run:
umount mountpoint/
dfgsdfgsd