<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.w9cr.net/index.php?action=history&amp;feed=atom&amp;title=Backups</id>
	<title>Backups - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.w9cr.net/index.php?action=history&amp;feed=atom&amp;title=Backups"/>
	<link rel="alternate" type="text/html" href="https://wiki.w9cr.net/index.php?title=Backups&amp;action=history"/>
	<updated>2026-05-28T21:47:25Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.34.4</generator>
	<entry>
		<id>https://wiki.w9cr.net/index.php?title=Backups&amp;diff=7369&amp;oldid=prev</id>
		<title>Bryan: /* Install nessary packages */</title>
		<link rel="alternate" type="text/html" href="https://wiki.w9cr.net/index.php?title=Backups&amp;diff=7369&amp;oldid=prev"/>
		<updated>2023-01-18T17:27:29Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Install nessary packages&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 17:27, 18 January 2023&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l9&quot; &gt;Line 9:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 9:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Install nessary packages==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Install nessary packages==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  apt-get install libacl1-dev python3-dev libssl-dev gcc g++ python3-llfuse&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  apt-get install libacl1-dev python3-dev libssl-dev gcc g++ python3-llfuse &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;pkg-config&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== install pip ==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== install pip ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Bryan</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.w9cr.net/index.php?title=Backups&amp;diff=4525&amp;oldid=prev</id>
		<title>Bryan: Created page with &quot;=Server Backups=  AllStarLink, Inc uses a per server backup method based on borg.  = Installing Borg on Ubuntu 16 =   the default package that ships with ubuntu 16.04 LTS is b...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.w9cr.net/index.php?title=Backups&amp;diff=4525&amp;oldid=prev"/>
		<updated>2019-11-29T15:46:55Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;=Server Backups=  AllStarLink, Inc uses a per server backup method based on borg.  = Installing Borg on Ubuntu 16 =   the default package that ships with ubuntu 16.04 LTS is b...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;=Server Backups=&lt;br /&gt;
&lt;br /&gt;
AllStarLink, Inc uses a per server backup method based on borg.&lt;br /&gt;
&lt;br /&gt;
= Installing Borg on Ubuntu 16 = &lt;br /&gt;
&lt;br /&gt;
the default package that ships with ubuntu 16.04 LTS is borg 1.0 based and we use the latest 1.1 version as it has several security fixes.&lt;br /&gt;
&lt;br /&gt;
== Install nessary packages==&lt;br /&gt;
&lt;br /&gt;
 apt-get install libacl1-dev python3-dev libssl-dev gcc g++ python3-llfuse&lt;br /&gt;
&lt;br /&gt;
== install pip ==&lt;br /&gt;
&lt;br /&gt;
 curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py&lt;br /&gt;
 python3 get-pip.py&lt;br /&gt;
&lt;br /&gt;
== Install Borg ==&lt;br /&gt;
 pip3 install borgbackup&lt;br /&gt;
&lt;br /&gt;
== Test for proper version ==&lt;br /&gt;
 root:~# borg -V&lt;br /&gt;
 borg 1.1.7&lt;br /&gt;
&lt;br /&gt;
 which borg&lt;br /&gt;
 /usr/local/bin/borg&lt;br /&gt;
&lt;br /&gt;
== Install the scripts ==&lt;br /&gt;
This will install a new ssh key for root that matches the Rsync.net account and place the borg.inc program in the /root/ directory.&lt;br /&gt;
&lt;br /&gt;
 cd /&lt;br /&gt;
 tar -xvf /root/borg-root-config.tar &lt;br /&gt;
&lt;br /&gt;
= Edit the borg script= &lt;br /&gt;
&lt;br /&gt;
On the Db servers we add a command to dump the database to /var/mysql-backup-current.sql.bz2&lt;br /&gt;
&lt;br /&gt;
= Initialize the repo=&lt;br /&gt;
&lt;br /&gt;
Copy the export lines to your shell and run then do &lt;br /&gt;
&lt;br /&gt;
 echo $BORG_REPO&lt;br /&gt;
 ASLUSER@host.rsync.net:borg/ASL/db-ord&lt;br /&gt;
&lt;br /&gt;
The borg/ASL/db-ord needs to be created on the server&lt;br /&gt;
 ssh -t ASLUSER@host.rsync.net mkdir -p borg/ASL/db-ord&lt;br /&gt;
&lt;br /&gt;
now we need to init the repo at that location&lt;br /&gt;
 borg init -e keyfile-blake2 -p -v&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= export the key =&lt;br /&gt;
&lt;br /&gt;
 borg key export --paper&lt;br /&gt;
&lt;br /&gt;
Email this output GPG encrypted to the admin team members.&lt;br /&gt;
&lt;br /&gt;
'''If we lose this key, there is no way to restore the backup.'''  This means if the server dies, we need the paper key record and the passphrase.&lt;br /&gt;
&lt;br /&gt;
= Do the first backup = &lt;br /&gt;
&lt;br /&gt;
 /root/borg.inc&lt;br /&gt;
&lt;br /&gt;
Check that it's succeed &lt;br /&gt;
&lt;br /&gt;
= move borg.inc to cron =&lt;br /&gt;
&lt;br /&gt;
 mv /root/borg.inc /srv/borg.sh&lt;br /&gt;
&lt;br /&gt;
= edit crontab = &lt;br /&gt;
&lt;br /&gt;
edit /etc/crontab to run daily at 8am UTC&lt;br /&gt;
&lt;br /&gt;
 #borg backup&lt;br /&gt;
 30 8 * * *      root    /srv/borg.sh&lt;br /&gt;
&lt;br /&gt;
Reload the crontab file&lt;br /&gt;
&lt;br /&gt;
 service cron reload&lt;br /&gt;
&lt;br /&gt;
= Mounting and restoring =&lt;br /&gt;
Borg makes it easy to mount a backup on the server using &amp;quot;borgfs&amp;quot;.  &lt;br /&gt;
&lt;br /&gt;
If this is done on a different server or during a restore operation on new servers, the key files need to be imported from the paper key.  Selected admin users have the paper keys backed up in encrypted email.&lt;br /&gt;
&lt;br /&gt;
For example on a our db-fnt server:&lt;br /&gt;
&lt;br /&gt;
Take the first 5 lines from the /srv/borg.sh file and export them on the cli:&lt;br /&gt;
&lt;br /&gt;
 export BORG_REMOTE_PATH=/usr/local/bin/borg1/borg1&lt;br /&gt;
 export HOST=&lt;br /&gt;
 export BORG_REPO=&lt;br /&gt;
 export BORG_PASSPHRASE=&lt;br /&gt;
 export BORG=/usr/local/bin/borg&lt;br /&gt;
&lt;br /&gt;
Note if doing this on a different server, BORG_REPO= must be the server you intend to restore from.&lt;br /&gt;
&lt;br /&gt;
 #import the paper key &lt;br /&gt;
 borg key import --paper $BORG_REPO&lt;br /&gt;
  &lt;br /&gt;
 #make a directory to mount the backups on:&lt;br /&gt;
 mkdir /mnt/backups&lt;br /&gt;
   &lt;br /&gt;
 #now mount the borg repo&lt;br /&gt;
 borgfs $BORG_REPO /mnt/backups/&lt;br /&gt;
&lt;br /&gt;
The files will now be in /mnt/backups:&lt;br /&gt;
&lt;br /&gt;
 ls  /mnt/backups/&lt;br /&gt;
 db-fnt.allstarlink.org-2018-10-31_08:30  db-fnt.allstarlink.org-2019-02-28_08:30&lt;br /&gt;
 db-fnt.allstarlink.org-2018-11-30_08:30  db-fnt.allstarlink.org-2019-03-02_08:30&lt;br /&gt;
 db-fnt.allstarlink.org-2018-12-31_08:30  db-fnt.allstarlink.org-2019-03-03_08:30&lt;br /&gt;
 db-fnt.allstarlink.org-2019-01-31_08:30  db-fnt.allstarlink.org-2019-03-04_08:30&lt;br /&gt;
 db-fnt.allstarlink.org-2019-02-03_08:30  db-fnt.allstarlink.org-2019-03-05_08:30&lt;br /&gt;
 db-fnt.allstarlink.org-2019-02-10_08:30  db-fnt.allstarlink.org-2019-03-06_08:30&lt;br /&gt;
 db-fnt.allstarlink.org-2019-02-17_08:30  db-fnt.allstarlink.org-2019-03-07_08:30&lt;br /&gt;
 db-fnt.allstarlink.org-2019-02-24_08:30  db-fnt.allstarlink.org-2019-03-08_08:30&lt;br /&gt;
&lt;br /&gt;
You can now go into any of these directories and restore files as of the date for the respective directory using normal UNIX utilities. &lt;br /&gt;
&lt;br /&gt;
[[Category: Infrastructure]]&lt;/div&gt;</summary>
		<author><name>Bryan</name></author>
		
	</entry>
</feed>