Project

General

Profile

Borg backups » History » Revision 7

Revision 6 (Jamila Khan, 07/10/2019 11:19 AM) → Revision 7/8 (Jamila Khan, 07/12/2019 11:14 AM)

h1. Borg backups 

 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. 

 h2. What is Borg? 

 From the "Borg docs:":https://borgbackup.readthedocs.io/en/stable/ 

 > BorgBackup (short: Borg) is a deduplicating backup program. Optionally, it supports compression and authenticated encryption. 
 >  
 > The main goal of Borg is to provide an efficient and secure way to backup data. The data deduplication technique used makes Borg suitable for daily backups since only changes are stored. The authenticated encryption technique makes it suitable for backups to not fully trusted targets. 

 h2. Usage 

 Main borg docs: https://borgbackup.readthedocs.io/en/stable/ 

 List backups 

 <pre> 
 borg list /path/to/repo 
 </pre> 

 Mount a single backup 

 <pre> 
 borg mount /path/to/repo::individual_backup /tmp/mymountpoint 
 </pre> 

 Check viability of the repo 

 <pre> 
 borg check -v /path/to/repo 
 </pre> 


 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 


 h2. Setup 

 Install necessary packages, currently the best way to do that is by using jessie-backports. 

 <pre> 
 aptitude -t jessie-backports install python3-msgpack borgbackup 
 </pre> 


 The files borg, borglocal, borg.helper, and borglocal.helper should be placed in /usr/share/backupninja, permissions 644, owned by root:root. 

 <pre> 
 cd /usr/share/backupninja 
 wget https://redmine.palantetech.coop/attachments/download/7133/borg && wget https://redmine.palantetech.coop/attachments/download/7135/borg.helper && wget https://redmine.palantetech.coop/attachments/download/7136/borglocal && wget https://redmine.palantetech.coop/attachments/download/7134/borglocal.helper 
 chown root:root borg* && chmod 644 borg* 
 </pre> 


 The files 70-76 are example backupninja jobs, which would go in /etc/backup.d, permissions 600, owned by root:root. 

 <pre> 
 cd /etc/backup.d 
 wget https://redmine.palantetech.coop/attachments/download/7130/70-local.borglocal 
 wget https://redmine.palantetech.coop/attachments/download/7132/71-mfpl.borg 
 wget https://redmine.palantetech.coop/attachments/download/7138/75-borglocalbackupcheck.sh 
 wget https://redmine.palantetech.coop/attachments/download/7137/76-borgbackupcheck.sh 
 chown root:root 7* && chmod 600 7* 
 </pre> 

 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. 
 Necessary variables to change: device uuid, filesystem type, included and excluded files, directory to mount the usb drive to, passphrase 

 Job 71 is for backing up to either a local folder or a folder accessible by ssh on a remote host. 
 Necessary variables to change: included and excluded files, directory to put the backups in, host, ssh user, passphrase 

 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. 

 Please change the passphrase variable in these jobs to something other than "PASSPHRASE", or leave it empty, which will turn off encryption. 

 h3. troubleshooting 

 There is a version of the borg handler now included in newer versions of backupninja. 
 That handler requires two changes to job 71: 

 * need to add encryption = none just above the passphrase 
 * change the path to the directory to be the complete full path, not use the tilde for home like ~/backups/borgbackups/offal, and must start with a slash so /home/members/srlp/backups/srlp-sync/borgbackups not borgbackups/ 

 


 documentation: 
 https://0xacab.org/riseuplabs/backupninja/merge_requests/1 
 https://labs.riseup.net/code/projects/backupninja 
 https://borgbackup.readthedocs.io/en/stable/
Go to top