<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:webfeeds="http://webfeeds.org/rss/1.0">
  <channel>
    <title>Backup on staticnotes.org</title>
    <link>https://staticnotes.org/tags/backup/</link>
    <webfeeds:icon>https://staticnotes.org/logo.png</webfeeds:icon>
    <webfeeds:logo>https://staticnotes.org/logo.png</webfeeds:logo>
    <description>Recent content in Backup on staticnotes.org</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-US</language>
    <lastBuildDate>Mon, 31 Aug 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://staticnotes.org/tags/backup/index.xml" rel="self" type="application/rss+xml" /><image>
      <url>https://staticnotes.org/logo.png</url>
      <title>staticnotes.org</title>
      <link>https://staticnotes.org/tags/backup/</link>
    </image>
    
    <item>
      <title>Encrypted cloud backups with restic</title>
      <link>https://staticnotes.org/posts/cloud-backups-with-restic/</link>
      <pubDate>Mon, 31 Aug 2026 00:00:00 +0000</pubDate>
      
      <guid>https://staticnotes.org/posts/cloud-backups-with-restic/</guid>
      <description>&lt;p&gt;My current backup strategy is pretty inconsistent. I run a weekly system backup of my MacBook onto an external hardrive &lt;code&gt;sysbackup&lt;/code&gt; using &#xA;&lt;a href=&#34;https://bombich.com/&#34; &#xA;&#xA;    target=&#34;_blank&#34;&#xA;    &gt;CarbonCopyCloner&#xA;    &#xA;        &lt;span style=&#34;white-space: nowrap&#34;&gt;&amp;thinsp;&lt;svg&#xA;            style=&#34;height: 0.7em; width: 0.7em; padding-left: -0.2em;&#34; focusable=&#34;false&#34; data-prefix=&#34;fas&#34; data-icon=&#34;external-link-alt&#34;&#xA;            class=&#34;svg-inline--fa fa-external-link-alt fa-w-16&#34; role=&#34;img&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&#xA;            viewBox=&#34;0 0 512 512&#34;&gt;&#xA;            &lt;path fill=&#34;currentColor&#34;&#xA;                d=&#34;M432,320H400a16,16,0,0,0-16,16V448H64V128H208a16,16,0,0,0,16-16V80a16,16,0,0,0-16-16H48A48,48,0,0,0,0,112V464a48,48,0,0,0,48,48H400a48,48,0,0,0,48-48V336A16,16,0,0,0,432,320ZM488,0h-128c-21.37,0-32.05,25.91-17,41l35.73,35.73L135,320.37a24,24,0,0,0,0,34L157.67,377a24,24,0,0,0,34,0L435.28,133.32,471,169c15,15,41,4.5,41-17V24A24,24,0,0,0,488,0Z&#34;&gt;&#xA;            &lt;/path&gt;&#xA;        &lt;/svg&gt;&#xA;    &lt;/span&gt;&#xA;        &#xA;    &#xA;&lt;/a&gt;. I also have another external hardrive &lt;code&gt;photos1&lt;/code&gt; to store files that don&amp;rsquo;t fit onto my MacBook and which isn&amp;rsquo;t backed up at all. Unfortunately, this includes most of my photos and videos. Storing those photos in the cloud would be a convenient option. However, I am not comfortable uploading &lt;em&gt;important&lt;/em&gt; personal documents and photos to the cloud.&lt;span class=&#34;sidenote-number&#34;&gt;&lt;small class=&#34;sidenote&#34;&gt; Even if Google Photos is very insistent that I do so.&lt;/small&gt;&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;This status quo is eventually going to fail, e.g. if the &lt;code&gt;photos1&lt;/code&gt; drive breaks or both my MacBook and the &lt;code&gt;sysbackup&lt;/code&gt; drive get destroyed at the same time (burglary, fire, flooding, ransomware attack). Recently, my photo hardrive made unusually loud noises when plugged in, which prompted me to finally adopt a more solid backup approach.&lt;/p&gt;&#xA;&lt;p&gt;Generally for backups the 3-2-1 rule is recommended (3 copies, 2 different storage media, 1 off-site backup). To accomplish this I will periodically clone the external hardrive &lt;code&gt;photos1&lt;/code&gt; to a new external hardrive &lt;code&gt;photos2&lt;/code&gt; and also set up the off-site backup. This post is mostly about how I set up the cloud backup, but I will summarize the overall approach at the end as well.&lt;/p&gt;&#xA;&lt;h2 id=&#34;requirements-for-my-cloud-backup&#34; class=&#34;content-heading&#34;&gt;&#xA;  &lt;a class=&#34;heading-anchor&#34; href=&#34;#requirements-for-my-cloud-backup&#34; aria-label=&#34;Link to this section&#34;&gt;§&lt;/a&gt;Requirements for my cloud backup&#xA;&lt;/h2&gt;&#xA;&lt;p&gt;To find the right approach I wrote down my requirements:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;reliable and cheap cloud storage&lt;/li&gt;&#xA;&lt;li&gt;backups encrypted locally before upload&lt;/li&gt;&#xA;&lt;li&gt;open-source software to prevent vendor lock-in or software disappearing in 5 years.&lt;/li&gt;&#xA;&lt;li&gt;simple to use for someone comfortable with the command line&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;In the end I settled on &#xA;&lt;a href=&#34;https://restic.net/&#34; &#xA;&#xA;    target=&#34;_blank&#34;&#xA;    &gt;&lt;code&gt;restic&lt;/code&gt;&#xA;    &#xA;        &lt;span style=&#34;white-space: nowrap&#34;&gt;&amp;thinsp;&lt;svg&#xA;            style=&#34;height: 0.7em; width: 0.7em; padding-left: -0.2em;&#34; focusable=&#34;false&#34; data-prefix=&#34;fas&#34; data-icon=&#34;external-link-alt&#34;&#xA;            class=&#34;svg-inline--fa fa-external-link-alt fa-w-16&#34; role=&#34;img&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&#xA;            viewBox=&#34;0 0 512 512&#34;&gt;&#xA;            &lt;path fill=&#34;currentColor&#34;&#xA;                d=&#34;M432,320H400a16,16,0,0,0-16,16V448H64V128H208a16,16,0,0,0,16-16V80a16,16,0,0,0-16-16H48A48,48,0,0,0,0,112V464a48,48,0,0,0,48,48H400a48,48,0,0,0,48-48V336A16,16,0,0,0,432,320ZM488,0h-128c-21.37,0-32.05,25.91-17,41l35.73,35.73L135,320.37a24,24,0,0,0,0,34L157.67,377a24,24,0,0,0,34,0L435.28,133.32,471,169c15,15,41,4.5,41-17V24A24,24,0,0,0,488,0Z&#34;&gt;&#xA;            &lt;/path&gt;&#xA;        &lt;/svg&gt;&#xA;    &lt;/span&gt;&#xA;        &#xA;    &#xA;&lt;/a&gt; which works on Linux, macOS, Windows, encrypts data locally by default, and doesn&amp;rsquo;t need to run on a server.&lt;span class=&#34;sidenote-number&#34;&gt;&lt;small class=&#34;sidenote&#34;&gt; I also looked into &#xA;&lt;a href=&#34;https://www.borgbackup.org/&#34; &#xA;&#xA;    target=&#34;_blank&#34;&#xA;    &gt;BorgBackup&#xA;    &#xA;        &lt;span style=&#34;white-space: nowrap&#34;&gt;&amp;thinsp;&lt;svg&#xA;            style=&#34;height: 0.7em; width: 0.7em; padding-left: -0.2em;&#34; focusable=&#34;false&#34; data-prefix=&#34;fas&#34; data-icon=&#34;external-link-alt&#34;&#xA;            class=&#34;svg-inline--fa fa-external-link-alt fa-w-16&#34; role=&#34;img&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&#xA;            viewBox=&#34;0 0 512 512&#34;&gt;&#xA;            &lt;path fill=&#34;currentColor&#34;&#xA;                d=&#34;M432,320H400a16,16,0,0,0-16,16V448H64V128H208a16,16,0,0,0,16-16V80a16,16,0,0,0-16-16H48A48,48,0,0,0,0,112V464a48,48,0,0,0,48,48H400a48,48,0,0,0,48-48V336A16,16,0,0,0,432,320ZM488,0h-128c-21.37,0-32.05,25.91-17,41l35.73,35.73L135,320.37a24,24,0,0,0,0,34L157.67,377a24,24,0,0,0,34,0L435.28,133.32,471,169c15,15,41,4.5,41-17V24A24,24,0,0,0,488,0Z&#34;&gt;&#xA;            &lt;/path&gt;&#xA;        &lt;/svg&gt;&#xA;    &lt;/span&gt;&#xA;        &#xA;    &#xA;&lt;/a&gt; which probably would have worked as well. However, that requires running borg on the server.&lt;/small&gt;&lt;/span&gt; Moreover, the commands and basic configuration are straightforward.&lt;/p&gt;&#xA;&lt;h2 id=&#34;getting-cheap-space-in-the-cloud&#34; class=&#34;content-heading&#34;&gt;&#xA;  &lt;a class=&#34;heading-anchor&#34; href=&#34;#getting-cheap-space-in-the-cloud&#34; aria-label=&#34;Link to this section&#34;&gt;§&lt;/a&gt;Getting cheap space in the cloud&#xA;&lt;/h2&gt;&#xA;&lt;p&gt;I already have a Hetzner account to host my Nextcloud instance. Luckily, they offer very cheap storage. I got the &lt;em&gt;Hetzner 1TB Storage Box&lt;/em&gt; for 3.83€/month. This means my data is stored in their datacenter in Falkenstein, Germany.&lt;span class=&#34;sidenote-number&#34;&gt;&lt;small class=&#34;sidenote&#34;&gt; &#xA;&lt;a href=&#34;https://www.youtube.com/watch?v=MQeJYEN_lrg&#34; &#xA;&#xA;    target=&#34;_blank&#34;&#xA;    &gt;Here&#xA;    &#xA;&#xA;        &#xA;        &lt;span style=&#34;white-space: nowrap&#34;&gt;&amp;thinsp;&lt;svg&#xA;            style=&#34;height: 0.7em; width: 0.9em; margin-left: -0.2em;&#34; focusable=&#34;false&#34; data-prefix=&#34;fas&#34; data-icon=&#34;external-link-alt&#34;&#xA;            class=&#34;svg-inline--fa fa-external-link-alt fa-w-16&#34; role=&#34;img&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&#xA;            viewBox=&#34;0 0 448 512&#34;&gt;&#xA;            &lt;path fill=&#34;currentColor&#34;&#xA;                d=&#34;M549.7 124.1c-6.3-23.7-24.8-42.3-48.3-48.6C458.8 64 288 64 288 64S117.2 64 74.6 75.5c-23.5 6.3-42 24.9-48.3 48.6-11.4 42.9-11.4 132.3-11.4 132.3s0 89.4 11.4 132.3c6.3 23.7 24.8 41.5 48.3 47.8C117.2 448 288 448 288 448s170.8 0 213.4-11.5c23.5-6.3 42-24.2 48.3-47.8 11.4-42.9 11.4-132.3 11.4-132.3s0-89.4-11.4-132.3zm-317.5 213.5V175.2l142.7 81.2-142.7 81.2z&#34;&gt;&#xA;            &lt;/path&gt;&#xA;        &lt;/svg&gt;&#xA;    &lt;/span&gt;&#xA;&#xA;    &#xA;    &#xA;&lt;/a&gt; you can see the inside of their datacenter. &lt;/small&gt;&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;To set up the Hetzner Storage Box to work with restic, you need to enable &lt;code&gt;External Reachability&lt;/code&gt;, enable &lt;code&gt;SSH&lt;/code&gt;, and set a password in the Hetzner console. The communication between my local machine and the storage box will be via SSH and the file upload happens over &#xA;&lt;a href=&#34;https://en.wikipedia.org/wiki/SSH_File_Transfer_Protocol&#34; &#xA;&#xA;    target=&#34;_blank&#34;&#xA;    &gt;SFTP&#xA;    &#xA;        &lt;span style=&#34;white-space: nowrap&#34;&gt;&amp;thinsp;&lt;svg&#xA;                style=&#34;height: 0.7em; width: 0.7em; margin-left: -0.2em;&#34; focusable=&#34;false&#34; data-prefix=&#34;fas&#34; data-icon=&#34;external-link-alt&#34;&#xA;                class=&#34;svg-inline--fa fa-external-link-alt fa-w-16&#34; role=&#34;img&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&#xA;                viewBox=&#34;0 0 640 512&#34;&gt;&#xA;                &lt;path fill=&#34;currentColor&#34;&#xA;                    d=&#34;M640 51.2l-.3 12.2c-28.1 .8-45 15.8-55.8 40.3-25 57.8-103.3 240-155.3 358.6H415l-81.9-193.1c-32.5 63.6-68.3 130-99.2 193.1-.3 .3-15 0-15-.3C172 352.3 122.8 243.4 75.8 133.4 64.4 106.7 26.4 63.4 .2 63.7c0-3.1-.3-10-.3-14.2h161.9v13.9c-19.2 1.1-52.8 13.3-43.3 34.2 21.9 49.7 103.6 240.3 125.6 288.6 15-29.7 57.8-109.2 75.3-142.8-13.9-28.3-58.6-133.9-72.8-160-9.7-17.8-36.1-19.4-55.8-19.7V49.8l142.5 .3v13.1c-19.4 .6-38.1 7.8-29.4 26.1 18.9 40 30.6 68.1 48.1 104.7 5.6-10.8 34.7-69.4 48.1-100.8 8.9-20.6-3.9-28.6-38.6-29.4 .3-3.6 0-10.3 .3-13.6 44.4-.3 111.1-.3 123.1-.6v13.6c-22.5 .8-45.8 12.8-58.1 31.7l-59.2 122.8c6.4 16.1 63.3 142.8 69.2 156.7L559.2 91.8c-8.6-23.1-36.4-28.1-47.2-28.3V49.6l127.8 1.1 .2 .5z&#34;&gt;&#xA;                &lt;/path&gt;&#xA;            &lt;/svg&gt;&#xA;        &lt;/span&gt;&#xA;        &#xA;    &#xA;&lt;/a&gt; which is based on SSH.&lt;/p&gt;&#xA;&lt;p&gt;First I create a new pair of SSH keys and then upload the public key to the storage box. In short:&lt;span class=&#34;sidenote-number&#34;&gt;&lt;small class=&#34;sidenote&#34;&gt; I have more detailed notes on setting up SSH keys &#xA;&lt;a href=&#34;https://staticnotes.org/til/2025/11/how-to-set-up-multiple-ssh-keys/&#34; &#xA;&#xA;    target=&#34;_blank&#34;&#xA;    &gt;here&#xA;    &#xA;        &lt;span style=&#34;white-space: nowrap&#34;&gt;&amp;thinsp;&lt;svg&#xA;            style=&#34;height: 0.7em; width: 0.7em; padding-left: -0.2em;&#34; focusable=&#34;false&#34; data-prefix=&#34;fas&#34; data-icon=&#34;external-link-alt&#34;&#xA;            class=&#34;svg-inline--fa fa-external-link-alt fa-w-16&#34; role=&#34;img&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&#xA;            viewBox=&#34;0 0 512 512&#34;&gt;&#xA;            &lt;path fill=&#34;currentColor&#34;&#xA;                d=&#34;M432,320H400a16,16,0,0,0-16,16V448H64V128H208a16,16,0,0,0,16-16V80a16,16,0,0,0-16-16H48A48,48,0,0,0,0,112V464a48,48,0,0,0,48,48H400a48,48,0,0,0,48-48V336A16,16,0,0,0,432,320ZM488,0h-128c-21.37,0-32.05,25.91-17,41l35.73,35.73L135,320.37a24,24,0,0,0,0,34L157.67,377a24,24,0,0,0,34,0L435.28,133.32,471,169c15,15,41,4.5,41-17V24A24,24,0,0,0,488,0Z&#34;&gt;&#xA;            &lt;/path&gt;&#xA;        &lt;/svg&gt;&#xA;    &lt;/span&gt;&#xA;        &#xA;    &#xA;&lt;/a&gt;.&lt;/small&gt;&lt;/span&gt;&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;Create new SSH keys:&lt;/p&gt;&#xA;&lt;div class=&#34;code-block&#34; data-lang=&#34;terminal&#34;&gt;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code class=&#34;language-terminal&#34; data-lang=&#34;terminal&#34;&gt;$ ssh-keygen -t ed25519 -f ~/.ssh/storagebox&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;Add a host entry for the storagebox to your &lt;code&gt;~/.ssh/config&lt;/code&gt; file:&lt;/p&gt;&#xA;&lt;div class=&#34;code-block&#34;&gt;&lt;pre&gt;&lt;code&gt;Host storagebox&#xA;    HostName uXXXXXX.your-storagebox.de&#xA;    User uXXXXXX&#xA;    Port 23&#xA;    IdentityFile ~/.ssh/storagebox&#xA;    WarnWeakCrypto no-pq-kex&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;Copy the public SSH key to the storagebox:&lt;/p&gt;&#xA;&lt;div class=&#34;code-block&#34; data-lang=&#34;terminal&#34;&gt;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code class=&#34;language-terminal&#34; data-lang=&#34;terminal&#34;&gt;$ ssh-copy-id -p 23 -s -i ~/.ssh/storagebox.pub uXXXXXX@uXXXXXX.your-storagebox.de&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;You should now be able to interact via sftp without providing a separate password. Test that it works with:&lt;/p&gt;&#xA;&lt;div class=&#34;code-block&#34; data-lang=&#34;terminal&#34;&gt;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code class=&#34;language-terminal&#34; data-lang=&#34;terminal&#34;&gt;$ sftp storagebox&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#xA;&lt;h2 id=&#34;installing-and-configuring-restic&#34; class=&#34;content-heading&#34;&gt;&#xA;  &lt;a class=&#34;heading-anchor&#34; href=&#34;#installing-and-configuring-restic&#34; aria-label=&#34;Link to this section&#34;&gt;§&lt;/a&gt;Installing and configuring &lt;code&gt;restic&lt;/code&gt;&#xA;&lt;/h2&gt;&#xA;&lt;p&gt;I installed restic via homebrew with &lt;code&gt;brew install restic&lt;/code&gt;. I then configured two important environment variables in a new restic config file &lt;code&gt;~/.config/restic/env&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;div class=&#34;code-block&#34;&gt;&lt;pre&gt;&lt;code&gt;export RESTIC_REPOSITORY=&amp;#34;sftp:storagebox:/home/restic-backup&amp;#34;&#xA;export RESTIC_PASSWORD=passwordhere&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#xA;&lt;p&gt;&lt;code&gt;RESTIC_REPOSITORY&lt;/code&gt; is the director on the storage box where the backups are stored. This is called the &lt;em&gt;restic repository&lt;/em&gt;. &lt;code&gt;RESTIC_PASSWORD&lt;/code&gt; is the password that restic uses to encrypt my data locally before it is uploaded. To not forget it, I stored it in my password manager and also wrote it down in my notes.&lt;/p&gt;&#xA;&lt;p&gt;Next I created the restic repository on the storage box with:&lt;/p&gt;&#xA;&lt;div class=&#34;code-block&#34; data-lang=&#34;terminal&#34;&gt;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code class=&#34;language-terminal&#34; data-lang=&#34;terminal&#34;&gt;$ restic -r sftp:storagebox:/home/restic-backup init&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#xA;&lt;p&gt;This is all that is needed for the initial configuration. I can now start making backups.&lt;/p&gt;&#xA;&lt;h2 id=&#34;basic-restic-backup-commands&#34; class=&#34;content-heading&#34;&gt;&#xA;  &lt;a class=&#34;heading-anchor&#34; href=&#34;#basic-restic-backup-commands&#34; aria-label=&#34;Link to this section&#34;&gt;§&lt;/a&gt;Basic restic backup commands&#xA;&lt;/h2&gt;&#xA;&lt;p&gt;To backup the folder &lt;code&gt;~/important_docs/&lt;/code&gt; to the restic repository on the storage box I run:&lt;/p&gt;&#xA;&lt;div class=&#34;code-block&#34; data-lang=&#34;terminal&#34;&gt;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code class=&#34;language-terminal&#34; data-lang=&#34;terminal&#34;&gt;$ restic backup ~/important_docs --verbose&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#xA;&lt;p&gt;Restic calls the content of a directory at a specific point in time a &lt;em&gt;snapshot&lt;/em&gt;. This snapshot is now available in the repository and I can restore the whole snapshot or selected files of the directory back to my local machine.&lt;/p&gt;&#xA;&lt;p&gt;If I run the above backup command again, restic will create a second snapshot, but not upload any files as none have changed. This deduplication makes sure that the data is stored efficiently.&lt;/p&gt;&#xA;&lt;h2 id=&#34;inspecting-the-storage-box&#34; class=&#34;content-heading&#34;&gt;&#xA;  &lt;a class=&#34;heading-anchor&#34; href=&#34;#inspecting-the-storage-box&#34; aria-label=&#34;Link to this section&#34;&gt;§&lt;/a&gt;Inspecting the storage box&#xA;&lt;/h2&gt;&#xA;&lt;p&gt;To inspect the files in my storage box I use &#xA;&lt;a href=&#34;https://cyberduck.io/&#34; &#xA;&#xA;    target=&#34;_blank&#34;&#xA;    &gt;Cyberduck&#xA;    &#xA;        &lt;span style=&#34;white-space: nowrap&#34;&gt;&amp;thinsp;&lt;svg&#xA;            style=&#34;height: 0.7em; width: 0.7em; padding-left: -0.2em;&#34; focusable=&#34;false&#34; data-prefix=&#34;fas&#34; data-icon=&#34;external-link-alt&#34;&#xA;            class=&#34;svg-inline--fa fa-external-link-alt fa-w-16&#34; role=&#34;img&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&#xA;            viewBox=&#34;0 0 512 512&#34;&gt;&#xA;            &lt;path fill=&#34;currentColor&#34;&#xA;                d=&#34;M432,320H400a16,16,0,0,0-16,16V448H64V128H208a16,16,0,0,0,16-16V80a16,16,0,0,0-16-16H48A48,48,0,0,0,0,112V464a48,48,0,0,0,48,48H400a48,48,0,0,0,48-48V336A16,16,0,0,0,432,320ZM488,0h-128c-21.37,0-32.05,25.91-17,41l35.73,35.73L135,320.37a24,24,0,0,0,0,34L157.67,377a24,24,0,0,0,34,0L435.28,133.32,471,169c15,15,41,4.5,41-17V24A24,24,0,0,0,488,0Z&#34;&gt;&#xA;            &lt;/path&gt;&#xA;        &lt;/svg&gt;&#xA;    &lt;/span&gt;&#xA;        &#xA;    &#xA;&lt;/a&gt;. Create a new SFTP connection with the storage box details:&lt;/p&gt;&#xA;&lt;div class=&#34;code-block&#34;&gt;&lt;pre&gt;&lt;code&gt;Server: uXXXXXX.your-storagebox.de&#xA;Port: 22&#xA;Username: uXXXXXX&#xA;SSH Private Key: ~/.ssh/storagebox&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#xA;&lt;p&gt;This opens the file viewer:&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;image-wrapper&#34;&gt;&#xA;  &lt;img src=&#34;https://staticnotes.org/posts/cloud-backups-with-restic/cyberduck_files.png&#34; alt=&#34;Cyberduck&#34; loading=&#34;lazy&#34; /&gt;&#xA;  &lt;figcaption&gt;Figure 1. Restic repository files visible in my storage box.&lt;/figcaption&gt;&#xA;  &lt;/div&gt;&#xA;&lt;/figure&gt;&#xA;&lt;/p&gt;&#xA;&lt;p&gt;You can see that (encrypted) restic files have been uploaded to the subfolder &lt;code&gt;restic-backup&lt;/code&gt;.&lt;span class=&#34;sidenote-number&#34;&gt;&lt;small class=&#34;sidenote&#34;&gt; Of course you can also store other things in the storage box, e.g. I have a separate &lt;code&gt;sync&lt;/code&gt; folder that I use with &lt;code&gt;rsync&lt;/code&gt;.&lt;/small&gt;&lt;/span&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;working-with-snapshots&#34; class=&#34;content-heading&#34;&gt;&#xA;  &lt;a class=&#34;heading-anchor&#34; href=&#34;#working-with-snapshots&#34; aria-label=&#34;Link to this section&#34;&gt;§&lt;/a&gt;Working with snapshots&#xA;&lt;/h2&gt;&#xA;&lt;p&gt;Here are useful commands to inspect and manage snapshots taken in the past:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;To list all available snapshots in the repository: &lt;code&gt;restic snapshots&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;To list all files in a specific snapshot with id &lt;code&gt;073a90db&lt;/code&gt;: &lt;code&gt;restic ls 073a90db&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;To view the size of the restic repository, run  &lt;code&gt;restic stats --mode raw-data&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;restoring-backups&#34; class=&#34;content-heading&#34;&gt;&#xA;  &lt;a class=&#34;heading-anchor&#34; href=&#34;#restoring-backups&#34; aria-label=&#34;Link to this section&#34;&gt;§&lt;/a&gt;Restoring backups&#xA;&lt;/h2&gt;&#xA;&lt;p&gt;It is worth understanding how to restore a backed-up directory. Let&amp;rsquo;s say I want to restore snapshot &lt;code&gt;a798b76e&lt;/code&gt;. If I run&lt;/p&gt;&#xA;&lt;div class=&#34;code-block&#34; data-lang=&#34;terminal&#34;&gt;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code class=&#34;language-terminal&#34; data-lang=&#34;terminal&#34;&gt;$ restic restore a798b76e --target ~/restore-test&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#xA;&lt;p&gt;restic will reproduce all directories and files that are part of that snapshot in the provided target folder &lt;code&gt;restore-test&lt;/code&gt;. If I just want to restore a single file from a snapshot I can use the &lt;code&gt;--include&lt;/code&gt; flag, e.g.&lt;/p&gt;&#xA;&lt;div class=&#34;code-block&#34; data-lang=&#34;terminal&#34;&gt;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code class=&#34;language-terminal&#34; data-lang=&#34;terminal&#34;&gt;$ restic restore a798b76e --include photo_of_grandma.jpg --target ~/restore-test&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#xA;&lt;p&gt;This will restore &lt;code&gt;photo_of_grandma.jpg&lt;/code&gt; from snapshot &lt;code&gt;a798b76e&lt;/code&gt; and make it available in the folder &lt;code&gt;~/restore-test&lt;/code&gt;. Important: To restore you will implicitely or explicitely need your restic password. Make sure you have it available.&lt;/p&gt;&#xA;&lt;h2 id=&#34;managing-the-repositorys-size-and-integrity&#34; class=&#34;content-heading&#34;&gt;&#xA;  &lt;a class=&#34;heading-anchor&#34; href=&#34;#managing-the-repositorys-size-and-integrity&#34; aria-label=&#34;Link to this section&#34;&gt;§&lt;/a&gt;Managing the repository&amp;rsquo;s size and integrity&#xA;&lt;/h2&gt;&#xA;&lt;p&gt;Two additional commands help me manage the repository and its size. To make sure that the data on the storage box hasn&amp;rsquo;t been corrupted I periodically run:&lt;/p&gt;&#xA;&lt;div class=&#34;code-block&#34; data-lang=&#34;terminal&#34;&gt;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code class=&#34;language-terminal&#34; data-lang=&#34;terminal&#34;&gt;$ restic check&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#xA;&lt;p&gt;This performs a structural integrity check of the data in the repository. Do the available files and the index match? Are there files not in the index? Check that it can decrypt snapshot metadata. This check is fast because it doesn&amp;rsquo;t actually read any data. If I want to also check that files are correct I need to append &lt;code&gt;--read-data&lt;/code&gt; for a full repository read. This will likely take some time. Alternatively I can only check a subset of data with &lt;code&gt;--read-data-subset=5%&lt;/code&gt; or &lt;code&gt;--read-data-subset=500M&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;The other important command is &lt;code&gt;forget&lt;/code&gt;. My storage box only has a size of 1TB, so if I keep accumulating snapshots, I will eventually run out of space. &lt;code&gt;forget&lt;/code&gt; and &lt;code&gt;prune&lt;/code&gt; can be used to delete snapshots.&lt;/p&gt;&#xA;&lt;p&gt;To manually delete a snapshot with id &lt;code&gt;a798b76e&lt;/code&gt; I run:&lt;/p&gt;&#xA;&lt;div class=&#34;code-block&#34; data-lang=&#34;terminal&#34;&gt;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code class=&#34;language-terminal&#34; data-lang=&#34;terminal&#34;&gt;$ restic forget a798b76e&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#xA;&lt;p&gt;This only deletes the snapshot. It doesn&amp;rsquo;t actually delete the data that was exclusive to that snapshot (not part of another snapshot). To delete this data I need to follow up with &lt;code&gt;prune&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;div class=&#34;code-block&#34; data-lang=&#34;terminal&#34;&gt;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code class=&#34;language-terminal&#34; data-lang=&#34;terminal&#34;&gt;$ restic prune&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#xA;&lt;p&gt;or do it as part of the forget command:&lt;span class=&#34;sidenote-number&#34;&gt;&lt;small class=&#34;sidenote&#34;&gt;The restic docs recommend running a &lt;code&gt;restic check&lt;/code&gt; after pruning operations to flag any issues.&lt;/small&gt;&lt;/span&gt;&lt;/p&gt;&#xA;&lt;div class=&#34;code-block&#34; data-lang=&#34;terminal&#34;&gt;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code class=&#34;language-terminal&#34; data-lang=&#34;terminal&#34;&gt;$ restic forget a798b76e --prune&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#xA;&lt;p&gt;Instead of deleting a specific snapshot, I want to specify a deletion policy, e.g. &amp;ldquo;keep one backup for the last 6 month, one for the last 4 weeks, and daily for the current week.&amp;rdquo; Restic uses the &lt;code&gt;--keep-*&lt;/code&gt; flag to specify such a policy.&lt;span class=&#34;sidenote-number&#34;&gt;&lt;small class=&#34;sidenote&#34;&gt; Use the &lt;code&gt;--dry-run&lt;/code&gt; flag when trying this out the first time.&lt;/small&gt;&lt;/span&gt; Some example policies:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;&lt;code&gt;--keep-last n&lt;/code&gt; keep the &lt;code&gt;n&lt;/code&gt; last (most recent) snapshots.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;&lt;code&gt;--keep-daily n&lt;/code&gt; for the last &lt;code&gt;n&lt;/code&gt; days which have one or more snapshots, keep only the most recent one for each day.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;&lt;code&gt;--keep-weekly n&lt;/code&gt; for the last &lt;code&gt;n&lt;/code&gt; weeks which have one or more snapshots, keep only the most recent one for each week.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;These can be combined (union of snapshots). So for my desired policy I could use:&lt;/p&gt;&#xA;&lt;div class=&#34;code-block&#34; data-lang=&#34;terminal&#34;&gt;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code class=&#34;language-terminal&#34; data-lang=&#34;terminal&#34;&gt;$ restic forget --keep-daily 7 --keep-weekly 4 --keep-monthly 6 --prune --verbose&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#xA;&lt;p&gt;Note that one snapshot could fulfil multiple conditions.&lt;/p&gt;&#xA;&lt;h2 id=&#34;scheduling-and-profiles-with-resticprofile&#34; class=&#34;content-heading&#34;&gt;&#xA;  &lt;a class=&#34;heading-anchor&#34; href=&#34;#scheduling-and-profiles-with-resticprofile&#34; aria-label=&#34;Link to this section&#34;&gt;§&lt;/a&gt;Scheduling and profiles with &lt;code&gt;resticprofile&lt;/code&gt;&#xA;&lt;/h2&gt;&#xA;&lt;p&gt;So far I only have a set of CLI commands that I would have to remember to run periodically.&#xA;To actually make &lt;code&gt;restic&lt;/code&gt; work, I want &lt;em&gt;scheduling&lt;/em&gt; and &lt;em&gt;profiles&lt;/em&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Scheduling to reliably run the backup daily and profiles to have different command configurations for different backup sources, e.g. I want daily backups of core folders on my MacBook and only weekly backups for my external hard drive &lt;code&gt;photos1&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;I am using &#xA;&lt;a href=&#34;https://creativeprojects.github.io/resticprofile/&#34; &#xA;&#xA;    target=&#34;_blank&#34;&#xA;    &gt;resticprofile&#xA;    &#xA;        &lt;span style=&#34;white-space: nowrap&#34;&gt;&amp;thinsp;&lt;svg&#xA;            style=&#34;height: 0.7em; width: 0.7em; padding-left: -0.2em;&#34; focusable=&#34;false&#34; data-prefix=&#34;fas&#34; data-icon=&#34;external-link-alt&#34;&#xA;            class=&#34;svg-inline--fa fa-external-link-alt fa-w-16&#34; role=&#34;img&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&#xA;            viewBox=&#34;0 0 512 512&#34;&gt;&#xA;            &lt;path fill=&#34;currentColor&#34;&#xA;                d=&#34;M432,320H400a16,16,0,0,0-16,16V448H64V128H208a16,16,0,0,0,16-16V80a16,16,0,0,0-16-16H48A48,48,0,0,0,0,112V464a48,48,0,0,0,48,48H400a48,48,0,0,0,48-48V336A16,16,0,0,0,432,320ZM488,0h-128c-21.37,0-32.05,25.91-17,41l35.73,35.73L135,320.37a24,24,0,0,0,0,34L157.67,377a24,24,0,0,0,34,0L435.28,133.32,471,169c15,15,41,4.5,41-17V24A24,24,0,0,0,488,0Z&#34;&gt;&#xA;            &lt;/path&gt;&#xA;        &lt;/svg&gt;&#xA;    &lt;/span&gt;&#xA;        &#xA;    &#xA;&lt;/a&gt; for both which I install via homebrew&lt;/p&gt;&#xA;&lt;div class=&#34;code-block&#34; data-lang=&#34;terminal&#34;&gt;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code class=&#34;language-terminal&#34; data-lang=&#34;terminal&#34;&gt;$ brew tap creativeprojects/tap&#xA;$ brew install resticprofile&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#xA;&lt;p&gt;With &lt;code&gt;resticprofile&lt;/code&gt; I can use a &lt;code&gt;yml&lt;/code&gt; or &lt;code&gt;toml&lt;/code&gt; configuration file to specify commands and configurations for specific paths. I created two profiles here &lt;code&gt;~/.config/resticprofile/profiles.yml&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;div class=&#34;code-block&#34; data-lang=&#34;yml&#34;&gt;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-yml&#34; data-lang=&#34;yml&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nt&#34;&gt;version&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;1&amp;#34;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;c&#34;&gt;# default profile set up for files on my MacBook&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;default&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;  &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;repository&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;sftp:storagebox:/home/restic-backup&amp;#34;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;  &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;initialize&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;false&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;  &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;backup&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;    &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;source&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;      &lt;/span&gt;- &lt;span class=&#34;s2&#34;&gt;&amp;#34;~/core_data_from_my_macbook&amp;#34;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;  &#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;    &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;exclude&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;      &lt;/span&gt;- &lt;span class=&#34;s2&#34;&gt;&amp;#34;~/stuff_I_want_to_exclude/&amp;#34;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;    &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;exclude-file&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;      &lt;/span&gt;- &lt;span class=&#34;s2&#34;&gt;&amp;#34;~/.config/restic/excludes.txt&amp;#34;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;    &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;verbose&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;true&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;    &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;schedule&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;11:00&amp;#34;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;  &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;forget&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;    &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;path&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;~/core_data_from_my_macbook&amp;#34;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;    &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;keep-daily&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;m&#34;&gt;7&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;    &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;keep-weekly&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;m&#34;&gt;4&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;    &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;keep-monthly&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;m&#34;&gt;6&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;    &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;prune&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;true&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;    &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;schedule&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;12:00&amp;#34;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;  &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;check&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;    &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;read-data-subset&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;5%&amp;#34;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;    &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;schedule&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;12:30&amp;#34;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;c&#34;&gt;# for `photos1` external hard drive&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;photos&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;  &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;repository&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;sftp:storagebox:/home/restic-backup&amp;#34;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;  &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;initialize&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;false&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;  &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;backup&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;    &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;source&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;      &lt;/span&gt;- &lt;span class=&#34;s2&#34;&gt;&amp;#34;/Volumes/photos1/Photos&amp;#34;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;  &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;forget&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;    &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;path&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;/Volumes/photos1/Photos&amp;#34;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;    &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;prune&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;true&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;    &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;keep-last&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;m&#34;&gt;5&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&#xA;&lt;p&gt;The first profile &lt;code&gt;default&lt;/code&gt; configures my MacBook backups. It specifies which folders to backup and is configured to run daily at 11am. At 12pm &lt;code&gt;restic&lt;/code&gt; executes my forget policy on the specified paths and at 12:30 &lt;code&gt;restic&lt;/code&gt; runs an integrity check.&lt;/p&gt;&#xA;&lt;p&gt;I have set up a second profile &lt;code&gt;photos&lt;/code&gt; to configure backups from my external hard drive to the same remote restic repository. The backup command is not scheduled. I only run it after I have copied new photos onto the harddrive, which only really happens every few weeks. The forget policy ensures the last 5 snapshots are kept.&lt;/p&gt;&#xA;&lt;p&gt;To schedule this configuration, I run &lt;code&gt;resticprofile schedule&lt;/code&gt;. On macOS this schedules the jobs in the &lt;code&gt;launchd&lt;/code&gt; service manager.&lt;span class=&#34;sidenote-number&#34;&gt;&lt;small class=&#34;sidenote&#34;&gt; The first time this runs, macOS will require you to confirm permissions.&lt;/small&gt;&lt;/span&gt; I verified the schedule is set with &lt;code&gt;launchctl list | grep -i restic&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Moreover, you can show all configured profiles with&lt;/p&gt;&#xA;&lt;div class=&#34;code-block&#34; data-lang=&#34;terminal&#34;&gt;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code class=&#34;language-terminal&#34; data-lang=&#34;terminal&#34;&gt;$ resticprofile profiles&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#xA;&lt;p&gt;I run the backup command for the photos profile manually with&lt;/p&gt;&#xA;&lt;div class=&#34;code-block&#34; data-lang=&#34;terminal&#34;&gt;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code class=&#34;language-terminal&#34; data-lang=&#34;terminal&#34;&gt;$ resticprofile photos.backup&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#xA;&lt;h2 id=&#34;conclusion&#34; class=&#34;content-heading&#34;&gt;&#xA;  &lt;a class=&#34;heading-anchor&#34; href=&#34;#conclusion&#34; aria-label=&#34;Link to this section&#34;&gt;§&lt;/a&gt;Conclusion&#xA;&lt;/h2&gt;&#xA;&lt;p&gt;I have now been running this setup for a couple of weeks and so far I am happy with it. The important files on my MacBook are about 15GB which took 20-30min for the first uploaded snapshot. The &lt;code&gt;photos1&lt;/code&gt; hard drive has about 250GB of data which took 4-5h for the initial upload.&lt;/p&gt;&#xA;&lt;p&gt;It&amp;rsquo;s also nice that this setup allows me to change storage vendor seamlessly, e.g. I can switch to AWS S3 or Backblaze B2 by just modifying the config file.&lt;/p&gt;&#xA;&lt;h2 id=&#34;appendix&#34; class=&#34;content-heading&#34;&gt;&#xA;  &lt;a class=&#34;heading-anchor&#34; href=&#34;#appendix&#34; aria-label=&#34;Link to this section&#34;&gt;§&lt;/a&gt;Appendix&#xA;&lt;/h2&gt;&#xA;&lt;h3 id=&#34;launchd-schedules-with-closed-lid&#34; class=&#34;content-heading&#34;&gt;&#xA;  &lt;a class=&#34;heading-anchor&#34; href=&#34;#launchd-schedules-with-closed-lid&#34; aria-label=&#34;Link to this section&#34;&gt;§&lt;/a&gt;Launchd schedules with closed lid&#xA;&lt;/h3&gt;&#xA;&lt;p&gt;I noticed that some scheduled backups failed when my MacBook was asleep (lid closed). I think that it&amp;rsquo;s because launchd resumes scheduled jobs once the MacBook awakes but a network connection isn&amp;rsquo;t always immediately available. I added the &lt;code&gt;schedule-after-network-online: true&lt;/code&gt; setting to my &lt;code&gt;profiles.yml&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;h3 id=&#34;exclusion-file&#34; class=&#34;content-heading&#34;&gt;&#xA;  &lt;a class=&#34;heading-anchor&#34; href=&#34;#exclusion-file&#34; aria-label=&#34;Link to this section&#34;&gt;§&lt;/a&gt;Exclusion file&#xA;&lt;/h3&gt;&#xA;&lt;p&gt;My profile uses an exclusion file &lt;code&gt;~/.config/restic/excludes.txt&lt;/code&gt; to ignore certain types of files I don&amp;rsquo;t want to back up, e.g. build artefacts or temporary files:&lt;/p&gt;&#xA;&lt;div class=&#34;code-block&#34; data-lang=&#34;txt&#34;&gt;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-txt&#34; data-lang=&#34;txt&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;# Python&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;.venv&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;venv&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;__pycache__&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;*.pyc&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;.pytest_cache&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;.mypy_cache&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;.ruff_cache&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;.tox&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;*.egg-info&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;# Node / JS&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;node_modules&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;.next&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;.nuxt&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;.parcel-cache&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;# Editors &amp;amp; tooling&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;.idea&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;.vscode&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;*.swp&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;*~&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;# Caches &amp;amp; logs&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;.cache&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;*.log&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;*.tmp&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;.terraform&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;# OS junk&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;.DS_Store&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;._*&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;.Spotlight-V100&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;.fseventsd&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;.Trashes&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;.TemporaryItems&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;.DocumentRevisions-V100&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&#xA;&lt;p&gt;Additionally I use the flag &lt;code&gt;exclude-caches: true&lt;/code&gt;, which ignores all folders that have a &lt;code&gt;CACHEDIR.TAG&lt;/code&gt; file, e.g. Rust cache directories.&lt;/p&gt;&#xA;&lt;h3 id=&#34;locks&#34; class=&#34;content-heading&#34;&gt;&#xA;  &lt;a class=&#34;heading-anchor&#34; href=&#34;#locks&#34; aria-label=&#34;Link to this section&#34;&gt;§&lt;/a&gt;Locks&#xA;&lt;/h3&gt;&#xA;&lt;p&gt;Certain restic commands put a lock onto the repository while running to prevent multiple clients from working on the same files. I can list all locks with&lt;/p&gt;&#xA;&lt;div class=&#34;code-block&#34; data-lang=&#34;terminal&#34;&gt;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code class=&#34;language-terminal&#34; data-lang=&#34;terminal&#34;&gt;$ restic list locks&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#xA;&lt;p&gt;Sometimes failed commands leave the repository locked. If you are sure it&amp;rsquo;s safe to unlock it, run:&lt;/p&gt;&#xA;&lt;div class=&#34;code-block&#34; data-lang=&#34;terminal&#34;&gt;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code class=&#34;language-terminal&#34; data-lang=&#34;terminal&#34;&gt;$ restic unlock&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#xA;</description>
    </item>
    
  </channel>
</rss>
