BackupScheme » History » Version 1
Anonymous, 04/16/2022 04:11 PM
creating page
| 1 | 1 | h1. Backup Scheme |
|
|---|---|---|---|
| 2 | |||
| 3 | h2. Borg Backup |
||
| 4 | |||
| 5 | I discovered "BorgBackup":https://www.borgbackup.org/ a while back and decided to give it a chance. So far it works very well. |
||
| 6 | |||
| 7 | h3. Install |
||
| 8 | |||
| 9 | <pre> |
||
| 10 | $ sudo add-apt-repository ppa:costamagnagianfranco/borgbackup |
||
| 11 | $ sudo apt install borgbackup |
||
| 12 | </pre> |
||
| 13 | |||
| 14 | h3. Create Repo |
||
| 15 | |||
| 16 | # This assumes that the backup repo is located on file2. In the cases shown below file2 is mounted via nfs. |
||
| 17 | # Create backup repo and make a note of the password. |
||
| 18 | <pre> |
||
| 19 | $ borg init --encryption=repokey /mnt/file2/backups/Documents |
||
| 20 | </pre> |
||
| 21 | |||
| 22 | h3. Create Backup |
||
| 23 | |||
| 24 | # Be sure file2 is mounted via nfs. |
||
| 25 | # Create backup; note that the date/timestamp is a convention but the backup can be given any name. |
||
| 26 | <pre> |
||
| 27 | $ borg create --stats --progress --compression=lz4 /mnt/file2/backups/Documents::20220402_1202 /mnt/phalanx/Documents |
||
| 28 | $ borg list /mnt/file2/backups/Documents/ |
||
| 29 | </pre> |
||
| 30 | |||
| 31 | h1. Legacy Backup Scheme |
||
| 32 | |||
| 33 | Note these instructions are obsolete but are left for reference. |
||
| 34 | |||
| 35 | h2. Overview |
||
| 36 | |||
| 37 | The following items are currently backed up: |
||
| 38 | * Documents folder |
||
| 39 | * Pictures folder (includes iPhoto library) |
||
| 40 | * Trac site including git repo |
||
| 41 | |||
| 42 | Backup tarballs are compressed with "lrzip":http://ck.kolivas.org/apps/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... |
||
| 43 | |||
| 44 | Images (JPEGs) are using a neato compression software I found called "packJPG":https://github.com/packjpg/packJPG and my own wrapper utility called [[PhotoCompressArchiver|Photo Compress Archiver]]. |
||
| 45 | |||
| 46 | h2. Steps |
||
| 47 | |||
| 48 | # Make sure the latest lrzip is installed and phalanx is mounted. |
||
| 49 | # On prometheus, change to the HDD: |
||
| 50 | <pre> |
||
| 51 | $ cd /Volumes/Macintosh\ HD/ |
||
| 52 | </pre> |
||
| 53 | Make a backup directory corresponding to the current date, name it according to YYYYMMDD (e.g. 20131117 for November 17, 2013) format: |
||
| 54 | <pre> |
||
| 55 | $ mkdir 20131117 |
||
| 56 | $ cd 20131117 |
||
| 57 | </pre> |
||
| 58 | # Create tarball for Documents folder: |
||
| 59 | <pre> |
||
| 60 | $ tar cf documents.tar /Volumes/storage/Documents |
||
| 61 | </pre> |
||
| 62 | Compress Documents tarball: |
||
| 63 | <pre> |
||
| 64 | $ lrzip -L 9 documents.tar |
||
| 65 | </pre> |
||
| 66 | # Copy pictures folder to temporary location: |
||
| 67 | <pre> |
||
| 68 | $ cp -R /Volumes/storage/Pictures ~/Desktop/temp/ |
||
| 69 | </pre> |
||
| 70 | Run PCA on copy: |
||
| 71 | <pre> |
||
| 72 | $ ./pca -f ^\\._.+$ ~/Desktop/temp/Pictures 2>&1 | tee pca_log_20170302_1639.txt |
||
| 73 | </pre> |
||
| 74 | Create tarball of compressed pictures |
||
| 75 | <pre> |
||
| 76 | $ tar cf pictures.tar ~/Desktop/temp/Pictures |
||
| 77 | </pre> |
||
| 78 | Compress Pictures tarball: |
||
| 79 | <pre> |
||
| 80 | $ lrzip -L 9 pictures.tar |
||
| 81 | </pre> |
||
| 82 | # To create Trac tarball, you must ssh into phalanx (create a separate tab), create the tarball, then copy it to the `storage` share: |
||
| 83 | <pre> |
||
| 84 | <from phalanx> |
||
| 85 | $ sudo tar cf trac.tar trac |
||
| 86 | $ sudo chown dsorber:dsorber |
||
| 87 | $ mv trac.tar /storage |
||
| 88 | </pre> |
||
| 89 | From prometheus, grab tarball and compress: |
||
| 90 | <pre> |
||
| 91 | $ mv /Volumes/storage/trac.tar . |
||
| 92 | $ lrzip -L 9 trac.tar |
||
| 93 | </pre> |
||
| 94 | # Remove intermediate tar files: |
||
| 95 | <pre> |
||
| 96 | $ rm *.tar |
||
| 97 | </pre> |
||
| 98 | # Copy backup folder to phalanx and the external HDD. |
||
| 99 | # Finally, rsync backup to saga: |
||
| 100 | <pre> |
||
| 101 | $ rsync --bwlimit=1024 -Pvhe ssh * dsorber@saga.homelinux.org:/storage/backups/20170301 |
||
| 102 | </pre> |