<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https:///index.php?action=history&amp;feed=atom&amp;title=Encrypted_backups</id>
	<title>Encrypted backups - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https:///index.php?action=history&amp;feed=atom&amp;title=Encrypted_backups"/>
	<link rel="alternate" type="text/html" href=""/>
	<updated>2026-04-07T09:24:32Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.1</generator>
	<entry>
		<id></id>
		<title>Gr0x0rd: Created page with &quot;=Backup strategy=  The backup home for librti scripts and files is &#039;&#039;&#039;/opt/librti&#039;&#039;&#039;.  &lt;br&gt;&lt;br&gt; The folder, file folder and all subdirectories should be owned by root:sudo. Th...&quot;</title>
		<link rel="alternate" type="text/html" href=""/>
		<updated>2023-02-03T06:05:09Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;=Backup strategy=  The backup home for librti scripts and files is &amp;#039;&amp;#039;&amp;#039;/opt/librti&amp;#039;&amp;#039;&amp;#039;.  &amp;lt;br&amp;gt;&amp;lt;br&amp;gt; The folder, file folder and all subdirectories should be owned by root:sudo. Th...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;=Backup strategy=&lt;br /&gt;
&lt;br /&gt;
The backup home for librti scripts and files is &amp;#039;&amp;#039;&amp;#039;/opt/librti&amp;#039;&amp;#039;&amp;#039;. &lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The folder, file folder and all subdirectories should be owned by root:sudo. This will allow all users to view and modify the files using appropriate sudo commands.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Backups are done using tar and encrypted using gpg. A 32 bit passphrase is generated for each server.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;Br&amp;gt;&lt;br /&gt;
On the server, generate the passphrase.&lt;br /&gt;
 $ openssl rand -hex 32 &amp;gt; enc.key&lt;br /&gt;
&lt;br /&gt;
The command to encrypt files, and thus to be used in scripts, is thus&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#/bin/bash&lt;br /&gt;
datum=`/bin/date +%Y%m%d-%H`&lt;br /&gt;
ENCRYPTIONKEY=`cat /opt/librti/ssl/enc.key`&lt;br /&gt;
tar czvpf - --exclude=&amp;#039;^#&amp;#039; --verbatim-files-from -T /opt/librti/filelist.txt | \&lt;br /&gt;
gpg -c --batch --yes -z 0 --cipher-algo AES256 -o /opt/librti/backups/$HOSTNAME-${datum}.librti --passphrase-fd 9s 9&amp;lt; &amp;lt;(printf &amp;#039;%s&amp;#039; &amp;quot;$ENCRYPTIONKEY&amp;quot;) -&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To decrypt&lt;br /&gt;
 $ gpg --batch --yes --passphrase &amp;lt;phrase from enc.key&amp;gt; -o outputfile.tar.gz -d inputfile.librti&lt;br /&gt;
&lt;br /&gt;
==Connecting to Wasabi storage==&lt;br /&gt;
 $ sudo apt-get install s3cmd python3 python3-boto3&lt;br /&gt;
After install, set up the connection.&lt;br /&gt;
 $ s3cmd --configure&lt;br /&gt;
Enter in the access and secret key. When prompted for region&lt;br /&gt;
 us-east-1&lt;br /&gt;
For the S3 endpoint&lt;br /&gt;
 s3.wasabisys.com&lt;br /&gt;
Buckets are provisioned on the wasabi side (Roman did this first time). &lt;br /&gt;
 %(bucket)s.s3.wasabisys.com&lt;br /&gt;
Provide an encryption key. Store it in the vault. The path to gpg should be default. Use HTTPS. Leave the proxy blank.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Test the connection. It should work. &lt;br /&gt;
===View files on the s3 bucket===&lt;br /&gt;
 $ s3cmd la&lt;br /&gt;
This will also tell us the bucket name.&lt;br /&gt;
===Send a file to the s3 storage===&lt;br /&gt;
 $ s3cmd put /path/to/file s3://&amp;lt;bucket_name&amp;gt;&lt;br /&gt;
===Recursively send all files in a folder ===&lt;br /&gt;
 $ s3cmd sync --acl-private --recursive --skip-existing --multipart-chunk-size-mb=256 /path/to/files/ s3://&amp;lt;bucket-name&amp;gt;&lt;/div&gt;</summary>
		<author><name>Gr0x0rd</name></author>
	</entry>
</feed>