Project

General

Profile

Actions

Backup Scheme

Borg Backup

I discovered BorgBackup a while back and decided to give it a chance. So far it works very well.

Install

$ sudo add-apt-repository ppa:costamagnagianfranco/borgbackup
$ sudo apt install borgbackup

Create Repo

  1. This assumes that the backup repo is located on file2. In the cases shown below file2 is mounted via nfs.
  2. Create backup repo and make a note of the password.
    $ borg init --encryption=repokey /mnt/file2/backups/Documents
    

Create Backup

  1. Be sure file2 is mounted via nfs.
  2. Create backup; note that the date/timestamp is a convention but the backup can be given any name.
    $ borg create --stats --progress --compression=lz4 /mnt/file2/backups/Documents::20220402_1202 /mnt/phalanx/Documents    // can give any name
    $ borg create --stats --progress --compression=lz4 /mnt/file2/backups/Documents::{user}-{now} /mnt/phalanx/Documents     // use built-in variables
    $ borg list /mnt/file2/backups/Documents/
    

Legacy Backup Scheme

Note these instructions are obsolete but are left for reference.

Overview

The following items are currently backed up:
  • Documents folder
  • Pictures folder (includes iPhoto library)
  • Trac site including git repo

Backup tarballs are compressed with lrzip. Backups are stored on phalanx, on saga, and on an external HDD. I really should do this at the very least every 6 months, but right now I do it only when I remember. I should probably create a recurring calendar reminder and do it quarterly...

Images (JPEGs) are using a neato compression software I found called packJPG and my own wrapper utility called Photo Compress Archiver.

Steps

  1. Make sure the latest lrzip is installed and phalanx is mounted.
  2. On prometheus, change to the HDD:
    $ cd /Volumes/Macintosh\ HD/
    

    Make a backup directory corresponding to the current date, name it according to YYYYMMDD (e.g. 20131117 for November 17, 2013) format:
    $ mkdir 20131117
    $ cd 20131117
    
  3. Create tarball for Documents folder:
    $ tar cf documents.tar /Volumes/storage/Documents
    

    Compress Documents tarball:
    $ lrzip -L 9 documents.tar
    
  4. Copy pictures folder to temporary location:
    $ cp -R /Volumes/storage/Pictures ~/Desktop/temp/
    

    Run PCA on copy:
    $ ./pca -f ^\\._.+$ ~/Desktop/temp/Pictures 2>&1 | tee pca_log_20170302_1639.txt
    

    Create tarball of compressed pictures
    $ tar cf pictures.tar ~/Desktop/temp/Pictures
    

    Compress Pictures tarball:
    $ lrzip -L 9 pictures.tar
    
  5. To create Trac tarball, you must ssh into phalanx (create a separate tab), create the tarball, then copy it to the `storage` share:
    <from phalanx>
    $ sudo tar cf trac.tar trac
    $ sudo chown dsorber:dsorber
    $ mv trac.tar /storage
    

    From prometheus, grab tarball and compress:
    $ mv /Volumes/storage/trac.tar .
    $ lrzip -L 9 trac.tar
    
  6. Remove intermediate tar files:
    $ rm *.tar
    
  7. Copy backup folder to phalanx and the external HDD.
  8. Finally, rsync backup to saga:
    $ rsync --bwlimit=1024 -Pvhe ssh * dsorber@saga.homelinux.org:/storage/backups/20170301
    

Updated by about 4 years ago · 2 revisions