<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>restic &amp;mdash; cthululemon</title>
    <link>https://blog.cthululemon.com/tag:restic</link>
    <description>These are some thoughts; sometimes they&#39;re mine.</description>
    <pubDate>Tue, 28 Apr 2026 08:50:06 -0700</pubDate>
    <item>
      <title>My current hack for encrypted yunohost back-ups using restic</title>
      <link>https://blog.cthululemon.com/my-current-hack-for-encrypted-yunohost-back-ups-using-restic</link>
      <description>&lt;![CDATA[Because I&#39;m new to server provisioning and to self-hosting, I&#39;ve elected to use Yunohost to serve my single-person fediverse instance. It also serves this blog and a few other things. It&#39;s only been a couple of weeks, but it&#39;s been lovely so far and the documentation is excellent.&#xA;&#xA;!--more--&#xA;&#xA;Yunohost back-ups&#xA;&#xA;Back-ups are a particular concern to me; so is successfully restoring a back-up, but that&#39;s a problem for another day. The Yunohost web admin portal offers a ready way to manually back up the system--including config files and other important things--to /home/yunohost.backup/archives. It seems to prepare a json file and a tarball for each back-up. I&#39;ve explored neither but my three back-ups look like this:&#xA;&#xA;ls -lahF /home/yunohost.backup/archives/&#xA;total 67G&#xA;drwxrwx--- 2 root admins 4.0K May 29 11:18 ./&#xA;drwxrwx--- 4 root admins 4.0K May 22 13:26 ../&#xA;-rw-rw-rw- 1 root root   2.0K May 25 17:20 20240526-001735.info.json&#xA;-rw-rw-rw- 1 root root    14G May 25 17:20 20240526-001735.tar&#xA;-rw-rw-rw- 1 root root   2.0K May 26 14:03 20240526-205908.info.json&#xA;-rw-rw-rw- 1 root root    22G May 26 14:03 20240526-205908.tar&#xA;-rw-rw-rw- 1 root root   2.0K May 29 11:18 20240529-181256.info.json&#xA;-rw-rw-rw- 1 root root    31G May 29 11:18 20240529-181256.tar&#xA;&#xA;The admin portal does not yet provide a way to automate creating new or deleting old back-ups, although yunohost provides a powerful CLI tool yunohost backup {create,restore,list,info,download,delete} that could be automated via a cron job, system service, etc. This is on my to-do list, for now I&#39;m trying to remember to do manual back-ups; my memory is trash so my back-up system will also be trash until I sort this part out.&#xA;&#xA;Backing up the yunohost back-ups&#xA;&#xA;Anyway, with these back-ups created, I&#39;ve landed on restic as the tool I&#39;ll use to encrypt my the Yunohost back-ups. Their website provides pretty simple, thorough instructions for this command-line tool. It allows me to backup to a local drive, and VPS, and more. For now I&#39;ve just done prepared a separate local drive; I&#39;ll try to figure out how to do the sync to my linode account in the coming weeks.&#xA;&#xA;I plugged in a spare USB and followed the instrcuctions to initiate a restic repository on it. I immediately encountered an error: the drive that I had formatted was plugged in to /dev/sdb, but couldn&#39;t be written to because it wasn&#39;t mounted. After poking around online, I found this article to be extremely help. After setting up the drive to auto-mount, I needed to change permissions to allow non-root access like this:&#xA;&#xA;sudo setfacl -R -m u:username:rwx mount-point&#xA;&#xA;and replacing &#39;username&#39; with my non-privileged username and &#39;mount-point&#39; with the auto-mount folder I had just created.&#xA;&#xA;From here on out, following the restic instructions was simple and direct. For what it&#39;s worth, these backups are encrypted (yay!) but, the process for setting the password:&#xA;&#xA;export RESTICPASSWORD=some-strong-password&#xA;&#xA;Leaves the restic password as an environmental variable and in your shell history. Is this safe? I don&#39;t know! I deleted it from my shell history anyway.&#xA;&#xA;Things I still need to do&#xA;&#xA;Automate the yunohost back-ups&#xA;&#xA;Automate the local restic back-ups of the yunohost backups&#xA;&#xA;Figure out a strategy for paring older backups&#xA;&#xA;Create restic back-ups to an off-site VPS (linode, probably, for me)&#xA;&#xA;Restic snapshots can be iteratively smaller due to its ability to de-duplicate. I&#39;m not sure that it&#39;s able to since each of the yunohost back-ups is a tarball. I need to look into this and perhaps adjust strategies.&#xA;&#xA;Each of these things will be new to me and there&#39;s a lot to learn, so I&#39;ll probably document each one.&#xA;&#xA;#yunohost #restic #backups&#xA;&#xA;All posts CC BY-SA-NC 4.0 or later, unless otherwise stated. ]]&gt;</description>
      <content:encoded><![CDATA[<p>Because I&#39;m new to server provisioning <em>and</em> to self-hosting, I&#39;ve elected to use <a href="https://yunohost.org">Yunohost</a> to serve my single-person <a href="social.cthululemon.com">fediverse instance</a>. It also serves this blog and a few other things. It&#39;s only been a couple of weeks, but it&#39;s been lovely so far and the documentation is excellent.</p>



<h2 id="yunohost-back-ups">Yunohost back-ups</h2>

<p>Back-ups are a particular concern to me; so is successfully <em>restoring</em> a back-up, but that&#39;s a problem for another day. The Yunohost web admin portal offers a ready way to manually back up the system—including config files and other important things—to <code>/home/yunohost.backup/archives</code>. It seems to prepare a json file and a tarball for each back-up. I&#39;ve explored neither but my three back-ups look like this:</p>

<pre><code>ls -lahF /home/yunohost.backup/archives/
total 67G
drwxrwx--- 2 root admins 4.0K May 29 11:18 ./
drwxrwx--- 4 root admins 4.0K May 22 13:26 ../
-rw-rw-rw- 1 root root   2.0K May 25 17:20 20240526-001735.info.json
-rw-rw-rw- 1 root root    14G May 25 17:20 20240526-001735.tar
-rw-rw-rw- 1 root root   2.0K May 26 14:03 20240526-205908.info.json
-rw-rw-rw- 1 root root    22G May 26 14:03 20240526-205908.tar
-rw-rw-rw- 1 root root   2.0K May 29 11:18 20240529-181256.info.json
-rw-rw-rw- 1 root root    31G May 29 11:18 20240529-181256.tar
</code></pre>

<p>The admin portal does not yet provide a way to automate creating new or deleting old back-ups, although yunohost provides a powerful CLI tool <code>yunohost backup {create,restore,list,info,download,delete}</code> that could be automated via a cron job, system service, etc. This is on my to-do list, for now I&#39;m trying to remember to do manual back-ups; my memory is trash so my back-up system will also be trash until I sort this part out.</p>

<h2 id="backing-up-the-yunohost-back-ups">Backing up the yunohost back-ups</h2>

<p>Anyway, with these back-ups created, I&#39;ve landed on <a href="https://restic.readthedocs.io/en/stable/010_introduction.html">restic</a> as the tool I&#39;ll use to encrypt my the Yunohost back-ups. Their website provides pretty simple, thorough instructions for this command-line tool. It allows me to backup to a local drive, and VPS, and more. For now I&#39;ve just done prepared a separate local drive; I&#39;ll try to figure out how to do the sync to my linode account in the coming weeks.</p>

<p>I plugged in a spare USB and followed the instrcuctions to initiate a restic repository on it. I immediately encountered an error: the drive that I had formatted was plugged in to <code>/dev/sdb</code>, but couldn&#39;t be written to because it wasn&#39;t mounted. After poking around online, I found <a href="https://www.linuxbabe.com/desktop-linux/how-to-automount-file-systems-on-linux">this article</a> to be extremely help. After setting up the drive to auto-mount, I needed to change permissions to allow non-root access like this:</p>

<pre><code>sudo setfacl -R -m u:username:rwx mount-point
</code></pre>

<p>and replacing &#39;username&#39; with my non-privileged username and &#39;mount-point&#39; with the auto-mount folder I had just created.</p>

<p>From here on out, following the restic instructions was simple and direct. For what it&#39;s worth, these backups are encrypted (yay!) but, the process for setting the password:</p>

<pre><code>export RESTIC_PASSWORD=some-strong-password
</code></pre>

<p>Leaves the restic password as an environmental variable and in your shell history. Is this safe? I don&#39;t know! I deleted it from my shell history anyway.</p>

<h2 id="things-i-still-need-to-do">Things I still need to do</h2>
<ol><li><p>Automate the yunohost back-ups</p></li>

<li><p>Automate the local restic back-ups of the yunohost backups</p></li>

<li><p>Figure out a strategy for paring older backups</p></li>

<li><p>Create restic back-ups to an off-site VPS (linode, probably, for me)</p></li>

<li><p>Restic snapshots can be iteratively smaller due to its ability to de-duplicate. I&#39;m not sure that it&#39;s able to since each of the yunohost back-ups is a tarball. I need to look into this and perhaps adjust strategies.</p></li></ol>

<p>Each of these things will be new to me and there&#39;s a lot to learn, so I&#39;ll probably document each one.</p>

<p><a href="https://blog.cthululemon.com/tag:yunohost" class="hashtag"><span>#</span><span class="p-category">yunohost</span></a> <a href="https://blog.cthululemon.com/tag:restic" class="hashtag"><span>#</span><span class="p-category">restic</span></a> <a href="https://blog.cthululemon.com/tag:backups" class="hashtag"><span>#</span><span class="p-category">backups</span></a></p>

<p>All posts CC BY-SA-NC 4.0 or later, unless otherwise stated.</p>
]]></content:encoded>
      <guid>https://blog.cthululemon.com/my-current-hack-for-encrypted-yunohost-back-ups-using-restic</guid>
      <pubDate>Wed, 05 Jun 2024 20:46:18 -0700</pubDate>
    </item>
  </channel>
</rss>