Project

General

Profile

BackupScheme » History » Version 2

Anonymous, 06/04/2022 11:08 AM

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 2
$ borg create --stats --progress --compression=lz4 /mnt/file2/backups/Documents::20220402_1202 /mnt/phalanx/Documents    // can give any name
28
$ borg create --stats --progress --compression=lz4 /mnt/file2/backups/Documents::{user}-{now} /mnt/phalanx/Documents     // use built-in variables
29 1
$ borg list /mnt/file2/backups/Documents/
30
</pre>
31
32
h1. Legacy Backup Scheme
33
34
Note these instructions are obsolete but are left for reference.
35
36
h2. Overview
37
38
The following items are currently backed up:
39
* Documents folder
40
* Pictures folder (includes iPhoto library)
41
* Trac site including git repo
42
43
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...
44
45
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]].
46
47
h2. Steps
48
49
# Make sure the latest lrzip is installed and phalanx is mounted.
50
# On prometheus, change to the HDD:
51
<pre>
52
$ cd /Volumes/Macintosh\ HD/
53
</pre>
54
 Make a backup directory corresponding to the current date, name it according to YYYYMMDD (e.g. 20131117 for November 17, 2013) format:
55
<pre>
56
$ mkdir 20131117
57
$ cd 20131117
58
</pre>
59
# Create tarball for Documents folder:
60
<pre>
61
$ tar cf documents.tar /Volumes/storage/Documents
62
</pre>
63
 Compress Documents tarball:
64
<pre>
65
$ lrzip -L 9 documents.tar
66
</pre>
67
# Copy pictures folder to temporary location:
68
<pre>
69
$ cp -R /Volumes/storage/Pictures ~/Desktop/temp/
70
</pre>
71
 Run PCA on copy:
72
<pre>
73
$ ./pca -f ^\\._.+$ ~/Desktop/temp/Pictures 2>&1 | tee pca_log_20170302_1639.txt
74
</pre>
75
 Create tarball of compressed pictures
76
<pre>
77
$ tar cf pictures.tar ~/Desktop/temp/Pictures
78
</pre>
79
 Compress Pictures tarball:
80
<pre>
81
$ lrzip -L 9 pictures.tar
82
</pre>
83
# To create Trac tarball, you must ssh into phalanx (create a separate tab), create the tarball, then copy it to the `storage` share:
84
<pre>
85
<from phalanx>
86
$ sudo tar cf trac.tar trac
87
$ sudo chown dsorber:dsorber
88
$ mv trac.tar /storage
89
</pre>
90
 From prometheus, grab tarball and compress:
91
<pre>
92
$ mv /Volumes/storage/trac.tar .
93
$ lrzip -L 9 trac.tar
94
</pre>
95
# Remove intermediate tar files:
96
<pre>
97
$ rm *.tar
98
</pre>
99
# Copy backup folder to phalanx and the external HDD.
100
# Finally, rsync backup to saga:
101
<pre>
102
$ rsync --bwlimit=1024 -Pvhe ssh * dsorber@saga.homelinux.org:/storage/backups/20170301
103
</pre>