Project

General

Profile

Borg backups » History » Version 4

Jamila Khan, 06/13/2017 12:13 PM
adding usage

1 1 Jamila Khan
h1. Borg backups
2
3
This is documentation and scripts for using Borg backups with backupninja. This relies heavily on the work of "Jon Goldberg":https://github.com/PalanteJon, "Benzhaomin":https://0xacab.org/Benzhaomin, and "Guillaume Subiron":https://github.com/maethor.
4
5 4 Jamila Khan
h2. Usage
6
7
Main borg docs: https://borgbackup.readthedocs.io/en/stable/
8
9
List backups
10
11
<pre>
12
borg list /path/to/repo
13
</pre>
14
15
Mount a single backup
16
17
<pre>
18
borg mount /path/to/repo::individual_backup /tmp/mymountpoint
19
</pre>
20
21
Check viability of the repo
22
23
<pre>
24
borg check -v /path/to/repo
25
</pre>
26
27
28
If the backup has a passphrase, you'll need to enter it to do any of those commands. The passphrase should be in the client credentials, and will be in the /etc/backup.d/ jobs
29
30
31
h2. Setup
32
33 3 Jamila Khan
Install necessary packages, currently the best way to do that is by using jessie-backports.
34
35
<pre>
36
aptitude -t jessie-backports install python3-msgpack borgbackup
37
</pre>
38
39
40 1 Jamila Khan
The files borg, borglocal, borg.helper, and borglocal.helper should be placed in /usr/share/backupninja, permissions 644, owned by root:root.
41 2 Jamila Khan
42
<pre>
43
cd /usr/share/backupninja
44
wget https://hq.palantetech.coop/attachments/download/7133/borg && wget https://hq.palantetech.coop/attachments/download/7135/borg.helper && wget https://hq.palantetech.coop/attachments/download/7136/borglocal && wget https://hq.palantetech.coop/attachments/download/7134/borglocal.helper
45
chown root:root borg* && chmod 644 borg*
46
</pre>
47
48
49 1 Jamila Khan
The files 70-76 are example backupninja jobs, which would go in /etc/backup.d, permissions 600, owned by root:root.
50
51 2 Jamila Khan
<pre>
52
cd /etc/backup.d
53
wget https://hq.palantetech.coop/attachments/download/7130/70-local.borglocal
54
wget https://hq.palantetech.coop/attachments/download/7132/71-mfpl.borg
55
wget https://hq.palantetech.coop/attachments/download/7138/75-borglocalbackupcheck.sh
56
wget https://hq.palantetech.coop/attachments/download/7137/76-borgbackupcheck.sh
57
chown root:root 7* && chmod 600 7*
58
</pre>
59
60 1 Jamila Khan
Job 70 is for backing up to a usb drive, which will be mounted at the beginning of every job and unmounted at the end.
61 2 Jamila Khan
Necessary variables to change: device uuid, filesystem type, included and excluded files, directory to mount the usb drive to, passphrase
62
63 1 Jamila Khan
Job 71 is for backing up to either a local folder or a folder accessible by ssh on a remote host.
64 2 Jamila Khan
Necessary variables to change: included and excluded files, directory to put the backups in, host, ssh user, passphrase
65
66
Jobs 75 and 76 are for checking the viability of the job 70 and 71 backups respectively, and require coping over the variables from those jobs.
67 1 Jamila Khan
68
Please change the passphrase variable in these jobs to something other than "PASSPHRASE", or leave it empty, which will turn off encryption.
69
70
71
documentation:
72
https://0xacab.org/riseuplabs/backupninja/merge_requests/1
73
https://labs.riseup.net/code/projects/backupninja
74
https://borgbackup.readthedocs.io/en/stable/
Go to top