You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+13-16Lines changed: 13 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -1,13 +1,13 @@
1
1
# Simple backup scripts
2
2
3
-
This is a collections of scripts, which automate the backup process of Linux server using [Attic](https://attic-backup.org/), a deduplicating backup tool.
3
+
This is a collections of scripts, which automate the backup process of Linux server using [Borg](https://borgbackup.readthedocs.io), a deduplicating backup tool.
4
4
5
5
The starting point is `backup.sh`, which works in following way:
6
6
* The scripts starts.
7
7
***premount** scripts are executed.
8
-
* If Attic repository is remote, it's mounted.
8
+
* If Borg repository is remote, it's mounted.
9
9
***predump** scripts are executed.
10
-
*Attic creates backup point for each mountpoint defined in *general.sh*.
10
+
*Borg creates backup point for each mountpoint defined in *general.sh*.
11
11
***postdump** scripts are executed.
12
12
* If the repository is remote, it's unmounted.
13
13
***postmount** scripts are executed.
@@ -29,16 +29,16 @@ The plain file dump doesn't guarantee the database consistency. To address this
29
29
30
30
Scripts dumps first 512 bytes for each drive defined in `PREMOUNT_MBR_PHYSICAL_DEVICES`. This area contains the MBR and partition table.
31
31
32
-
## Copying Attic repository to secondary location
32
+
## Copying Borg repository to secondary location
33
33
34
-
`copy_attic_repository_rsync` side script can be used to copy the Attic repository to secondary remote location, which increases survivability in case of storage failure.
34
+
`copy_borg_repository_rsync` side script can be used to copy the repository to secondary remote location, which increases survivability in case of storage failure.
35
35
36
36
## Installation
37
37
38
38
* Install required packages:
39
39
40
40
```bash
41
-
aptitude install sshfs attic rsync lbzip2
41
+
aptitude install sshfs borgbackup rsync lbzip2
42
42
```
43
43
44
44
* Checkout the repository, preferable to *root*'s home directory:
* Go to *backup-scripts/conf.d* directory. There are several *.example* files. To enable the module, copy it's configuration file to it's proper name:
51
51
52
52
```
53
-
cp general.sh.example general.sh
53
+
cp example-general.sh general.sh
54
54
```
55
55
56
-
You shouldn't change name of the *.example* files, because you'll run into conflicts when you decide to pull the new version from the repository. *general.sh* is main configuration file, you should have it enabled and configured.
56
+
You shouldn't change name of the *example-* files, because you'll run into conflicts when you decide to pull the new version from the repository. *general.sh* is main configuration file, you should have it enabled and configured.
57
57
58
58
* After you're done with configuration, run the *backup.sh* script in verbose mode:
59
59
60
60
```
61
61
~/backup-scripts/backup.sh -v
62
62
```
63
63
64
-
First, it runs *premount* and *predump* modules. Then it initializes the Attic repository. You shouldn't set any password, because you won't be able to provide it during automated backup.
64
+
First, it runs *premount* and *predump* modules. Then it initializes the Borg repository. You shouldn't set any password, because you won't be able to provide it during automated backup.
65
65
66
66
The very first run deduplicates your whole filesystem, it'll take long. The subsequent runs are much faster.
67
67
@@ -78,18 +78,15 @@ The very first run deduplicates your whole filesystem, it'll take long. The subs
78
78
List list existing backups and choose the one which suits your needs the best.
79
79
80
80
```
81
-
attic list /my/backup/storage/myhostname/repository.attic/
81
+
borg list /my/backup/storage/myhostname/repository.borg/
82
82
```
83
83
84
-
Then access the files. The most convenient way is to use Attic*mount* feature:
84
+
Then access the files. The most convenient way is to use Borg*mount* feature:
85
85
86
86
```
87
-
attic mount /my/backup/storage/myhostname/repository.attic::{backup point} /tmp/restore
87
+
borg mount /my/backup/storage/myhostname/repository.borg::{backup point} /tmp/restore
88
88
```
89
89
90
-
**Warning!** Because of bug present in Attic, you always have to provide the full path to the repository.
91
-
92
-
93
90
### Restore MongoDB
94
91
95
92
These commands will erase the content from the database and replace it with version from the backup.
If you enabled encryption, Attic stores the encryption keys in `~/.attic/keys`. Remember to backup them separately; you won't be able to use your backup if you loose them!
101
+
If you enabled encryption, Borg stores the encryption keys in `~/.config/borg/keys`. All keys are encrypted with password `backup`. The key to the security is to hold them in secure location. Remember to backup them separately; you won't be able to use your backup if you loose them!
0 commit comments