<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0">
    <channel>
      <title>~&#x2F;magostinelli - backup</title>
      <link>https://www.agostinelli.eu</link>
      <description>La casa delle mie passioni</description>
      <generator>Zola</generator>
      <language>it</language>
      <atom:link href="https://www.agostinelli.eu/tags/backup/rss.xml" rel="self" type="application/rss+xml"/>
      <lastBuildDate>Tue, 17 Feb 2026 00:00:00 +0000</lastBuildDate>
      <item>
          <title>Backup con Borg e Borgmatic</title>
          <pubDate>Tue, 17 Feb 2026 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://www.agostinelli.eu/blog/backup-con-borg-e-borgmatic/</link>
          <guid>https://www.agostinelli.eu/blog/backup-con-borg-e-borgmatic/</guid>
          <description xml:base="https://www.agostinelli.eu/blog/backup-con-borg-e-borgmatic/">&lt;h1 id=&quot;backup-con-borg-e-borgmatic&quot;&gt;&lt;a class=&quot;header-anchor no-hover-padding&quot; href=&quot;#backup-con-borg-e-borgmatic&quot; aria-label=&quot;Anchor link for: backup-con-borg-e-borgmatic&quot;&gt;&lt;span class=&quot;link-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;&#x2F;span&gt;&lt;&#x2F;a&gt;
Backup con Borg e Borgmatic&lt;&#x2F;h1&gt;
&lt;p&gt;Se anche tu sei un self-host compulsivo, la questione dei &lt;strong&gt;backup&lt;&#x2F;strong&gt; non è una scelta, ma una &lt;strong&gt;necessità&lt;&#x2F;strong&gt;. Dopo anni di utilizzo e varie prove, su tutti i miei server, utilizzo Borg come software per il backup: non solo è molto affidabile (ho avuto bisogno del restore qualche volta) ma anche straordinariamente semplice da gestire.&lt;&#x2F;p&gt;
&lt;p&gt;In questo articolo ti mostrerò perché questi due software hanno conquistato il mio cuore (e i miei dati), come funzionano e soprattutto come iniziare a usarli nel tuo ambiente self-hosted.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;chi-e-borg-e-perche-dovresti-usarlo&quot;&gt;&lt;a class=&quot;header-anchor no-hover-padding&quot; href=&quot;#chi-e-borg-e-perche-dovresti-usarlo&quot; aria-label=&quot;Anchor link for: chi-e-borg-e-perche-dovresti-usarlo&quot;&gt;&lt;span class=&quot;link-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;&#x2F;span&gt;&lt;&#x2F;a&gt;
Chi è Borg e Perché Dovresti Usarlo&lt;&#x2F;h2&gt;
&lt;p&gt;Borg (BorgBackup) è un software di backup dedicato alla deduplica, compressione e cifratura dei dati. Sviluppato in Python con componenti critici in C, è stato pensato fin dall&#x27;inizio per essere veloce, efficiente e sicuro. A differenza di soluzioni più tradizionali, Borg non crea semplici copie dei tuoi file, ma applica una serie di tecniche sofisticate per rendere i backup efficienti e gestibili.&lt;&#x2F;p&gt;
&lt;p&gt;Borgmatic è un&#x27;&lt;em&gt;estensione&lt;&#x2F;em&gt; di Borg e permette di configurare il nostro backup attraverso un unico file di configurazione.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;img src=&quot;https:&#x2F;&#x2F;img.agostinelli.eu&#x2F;2026&#x2F;borg-logo.png&quot; alt=&quot;Borg&quot; &#x2F;&gt;&lt;&#x2F;p&gt;
&lt;h3 id=&quot;le-tre-caratteristiche-che-cambiano-il-gioco&quot;&gt;&lt;a class=&quot;header-anchor no-hover-padding&quot; href=&quot;#le-tre-caratteristiche-che-cambiano-il-gioco&quot; aria-label=&quot;Anchor link for: le-tre-caratteristiche-che-cambiano-il-gioco&quot;&gt;&lt;span class=&quot;link-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;&#x2F;span&gt;&lt;&#x2F;a&gt;
Le Tre Caratteristiche che Cambiano il Gioco&lt;&#x2F;h3&gt;
&lt;p&gt;&lt;strong&gt;Deduplica&lt;&#x2F;strong&gt;: Questo è il punto che rende Borg veramente speciale. Immagina di avere 100 GB di dati e di fare un backup ogni giorno. Con i backup tradizionali, finiresti per avere 2.8 TB di dati in un mese (100 GB × 28 giorni). Con Borg, se solo il 5% dei tuoi dati cambia ogni giorno, utilizzerai solo circa 140 GB di spazio totale (100 GB iniziali + 5 GB × 28 giorni). Borg identifica i file identici e i blocchi di dati duplicati, memorizzandoli una sola volta.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Compressione&lt;&#x2F;strong&gt;: Borg comprime i dati utilizzando algoritmi come ZSTD, riducendo ulteriormente lo spazio occupato. Un documento di testo compresso può ridursi del 90%, immagini del 20-30%, database del 40-60%. La compressione avviene durante il backup, non dopo, quindi non impatta sulla velocità di accesso ai dati ripristinati.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Cifratura&lt;&#x2F;strong&gt;: Tutti i tuoi backup sono cifrati end-to-end con AES-256. Significa che anche se qualcuno riuscisse ad accedere al tuo repository di backup, non potrebbe leggere nulla senza la passphrase. La cifratura viene applicata sia in transito (se usi SSH) che a riposo sul disco.&lt;&#x2F;p&gt;
&lt;p&gt;Grazie a queste tre caratteristiche puoi usare anche un servizio esterno per il tuo backup, cosi avrai i tuoi dati al sicuro in un luogo diverso rispetto a quello di dove girano i tuoi servizi.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;il-vantaggio-decisivo-point-in-time-recovery&quot;&gt;&lt;a class=&quot;header-anchor no-hover-padding&quot; href=&quot;#il-vantaggio-decisivo-point-in-time-recovery&quot; aria-label=&quot;Anchor link for: il-vantaggio-decisivo-point-in-time-recovery&quot;&gt;&lt;span class=&quot;link-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;&#x2F;span&gt;&lt;&#x2F;a&gt;
Il Vantaggio Decisivo: Point-in-Time Recovery&lt;&#x2F;h2&gt;
&lt;p&gt;Tra le molte cose che Borg fa bene, il point-in-time recovery è una capacità che raramente ho visto in altri backup tools gratuiti. Cosa significa? Semplicemente che puoi ripristinare i tuoi dati a qualsiasi punto nel tempo in cui hai eseguito un backup.&lt;&#x2F;p&gt;
&lt;p&gt;Facciamo un esempio concreto. Sei lunedì alle 14:30 e realizzi che un file importante è stato eliminato accidentalmente venerdì scorso. Con Borg, puoi accedere al backup di giovedì mattina alle 08:00 e recuperare esattamente quello che ti serve. Non è &quot;il file è sparito, è perso per sempre&quot;, ma &quot;posso scegliere quale versione del mio sistema voglio ripristinare&quot;.&lt;&#x2F;p&gt;
&lt;p&gt;Questo funziona perché ogni volta che esegui un backup con Borg, viene creato un &quot;snapshot&quot; completo dello stato del tuo sistema in quel momento. Borg poi usa la deduplica per assicurarsi che lo spazio aggiuntivo necessario sia minimo, ma tu mantieni sempre accesso a qualsiasi versione precedente.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;borg-in-pratica-cosa-devi-sapere&quot;&gt;&lt;a class=&quot;header-anchor no-hover-padding&quot; href=&quot;#borg-in-pratica-cosa-devi-sapere&quot; aria-label=&quot;Anchor link for: borg-in-pratica-cosa-devi-sapere&quot;&gt;&lt;span class=&quot;link-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;&#x2F;span&gt;&lt;&#x2F;a&gt;
Borg in Pratica: Cosa Devi Sapere&lt;&#x2F;h2&gt;
&lt;p&gt;Borg è estremamente flessibile e può essere usato in molti modi diversi. Ecco gli scenari che coprono la maggior parte dei casi d&#x27;uso:&lt;&#x2F;p&gt;
&lt;h3 id=&quot;local-to-local-il-backup-nel-tuo-ufficio&quot;&gt;&lt;a class=&quot;header-anchor no-hover-padding&quot; href=&quot;#local-to-local-il-backup-nel-tuo-ufficio&quot; aria-label=&quot;Anchor link for: local-to-local-il-backup-nel-tuo-ufficio&quot;&gt;&lt;span class=&quot;link-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;&#x2F;span&gt;&lt;&#x2F;a&gt;
Local-to-Local: Il Backup nel Tuo Ufficio&lt;&#x2F;h3&gt;
&lt;p&gt;Il caso più semplice è fare il backup dei tuoi dati locali su un disco esterno o su un&#x27;altra partizione. È velocissimo e non richiede internet. Il comando base è:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;bash&quot; class=&quot;language-bash z-code&quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;borg&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; init&lt;span class=&quot;z-variable z-parameter z-option z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-parameter z-shell&quot;&gt; --&lt;&#x2F;span&gt;encryption&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator z-assignment z-option z-shell&quot;&gt;=&lt;&#x2F;span&gt;repokey &#x2F;mnt&#x2F;backup&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;borg&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; create &#x2F;mnt&#x2F;backup::&lt;span class=&quot;z-meta z-group z-expansion z-brace z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-section z-expansion z-brace z-begin z-shell&quot;&gt;{&lt;&#x2F;span&gt;now&lt;span class=&quot;z-punctuation z-section z-expansion z-brace z-end z-shell&quot;&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt; &#x2F;home&#x2F;utente&#x2F;dati&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Perfetto per chi vuole un backup fisico nelle vicinanze e non si preoccupa di perdere tutto se la casa prende fuoco (per quello servono i backup remoti).&lt;&#x2F;p&gt;
&lt;h3 id=&quot;self-hosted-il-backup-su-un-altro-server&quot;&gt;&lt;a class=&quot;header-anchor no-hover-padding&quot; href=&quot;#self-hosted-il-backup-su-un-altro-server&quot; aria-label=&quot;Anchor link for: self-hosted-il-backup-su-un-altro-server&quot;&gt;&lt;span class=&quot;link-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;&#x2F;span&gt;&lt;&#x2F;a&gt;
Self-Hosted: Il Backup su un Altro Server&lt;&#x2F;h3&gt;
&lt;p&gt;Questo è il mio setup preferito per il self-hosting. Hai il tuo server principale dove girano Nextcloud, il tuo Git personale, la tua email, quello che vuoi. E hai un secondo server (anche molto meno potente) dove archi i backup.&lt;&#x2F;p&gt;
&lt;p&gt;Borg comunica via SSH e comprime&#x2F;cifra tutto prima di inviare i dati. Anche se il server di backup venisse compromesso, non potrebbero leggere nulla. Il comando diventa:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;bash&quot; class=&quot;language-bash z-code&quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;borg&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; create ssh:&#x2F;&#x2F;utente@backup.example.com:22&#x2F;path&#x2F;to&#x2F;repo::&lt;span class=&quot;z-meta z-group z-expansion z-brace z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-section z-expansion z-brace z-begin z-shell&quot;&gt;{&lt;&#x2F;span&gt;now&lt;span class=&quot;z-punctuation z-section z-expansion z-brace z-end z-shell&quot;&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt; &#x2F;dati&#x2F;importanti&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Bellissimo, vero? Un server, una passphrase, tutto cifrato. E lo spazio utilizzato è ridicolmente piccolo grazie alla deduplica.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;un-dettaglio-fondamentale-il-modello-client-server&quot;&gt;&lt;a class=&quot;header-anchor no-hover-padding&quot; href=&quot;#un-dettaglio-fondamentale-il-modello-client-server&quot; aria-label=&quot;Anchor link for: un-dettaglio-fondamentale-il-modello-client-server&quot;&gt;&lt;span class=&quot;link-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;&#x2F;span&gt;&lt;&#x2F;a&gt;
Un Dettaglio Fondamentale: Il Modello Client-Server&lt;&#x2F;h3&gt;
&lt;p&gt;C&#x27;è una cosa importante da capire se decidi di fare il backup su un server remoto: Borg deve essere &lt;strong&gt;installato su entrambe le macchine&lt;&#x2F;strong&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;A differenza di altri strumenti che usano il protocollo SFTP o rsync &quot;passivo&quot;, Borg utilizza un modello &lt;em&gt;client-server&lt;&#x2F;em&gt;. Quando avvii un backup, il tuo server locale (il client) si connette via SSH al server di destinazione e avvia un&#x27;istanza di Borg anche lì (il server).&lt;&#x2F;p&gt;
&lt;p&gt;Perché questa complicazione? In realtà è un enorme vantaggio per due motivi:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Efficienza: Il server remoto calcola localmente quali pezzi di dati possiede già, evitando di farti inviare file che sono già nel repository.&lt;&#x2F;li&gt;
&lt;li&gt;Integrità: Il processo remoto verifica che i dati arrivino correttamente e gestisce la scrittura sul disco in modo atomico.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;Ad esempio, se stai usando una VPS Debian come destinazione, ricordati di fare un semplice &lt;code&gt;apt install borgbackup&lt;&#x2F;code&gt;, altrimenti il client non saprà con chi parlare e riceverai un errore del tipo &lt;em&gt;Remote: bash: borg: command not found&lt;&#x2F;em&gt;.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;servizi-di-terze-parti-hetzner-e-simili&quot;&gt;&lt;a class=&quot;header-anchor no-hover-padding&quot; href=&quot;#servizi-di-terze-parti-hetzner-e-simili&quot; aria-label=&quot;Anchor link for: servizi-di-terze-parti-hetzner-e-simili&quot;&gt;&lt;span class=&quot;link-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;&#x2F;span&gt;&lt;&#x2F;a&gt;
Servizi di Terze Parti: Hetzner e Simili&lt;&#x2F;h3&gt;
&lt;p&gt;Se non vuoi gestire il tuo server di backup, ci sono servizi come Hetzner Storage Box che offrono spazio di backup a costi molto bassi (qualche euro al mese per TB). Borg lavora perfettamente con loro e mantiene la stessa garanzia di cifratura end-to-end.&lt;&#x2F;p&gt;
&lt;p&gt;Ad esempio, Hetzner (non mi hanno sponsorizzato), offre un servizio molto economico e ben funzionante chiamato storage box: https:&#x2F;&#x2F;www.hetzner.com&#x2F;storage&#x2F;storage-box&#x2F;
(Ci sono pacchetti con vari tagli di spazio disco).&lt;&#x2F;p&gt;
&lt;h2 id=&quot;borg-e-l-ecosistema-self-hosted&quot;&gt;&lt;a class=&quot;header-anchor no-hover-padding&quot; href=&quot;#borg-e-l-ecosistema-self-hosted&quot; aria-label=&quot;Anchor link for: borg-e-l-ecosistema-self-hosted&quot;&gt;&lt;span class=&quot;link-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;&#x2F;span&gt;&lt;&#x2F;a&gt;
Borg e l&#x27;Ecosistema Self-Hosted&lt;&#x2F;h2&gt;
&lt;p&gt;Due sistemi che uso hanno adottato Borg come soluzione di backup nativa:&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;YunoHost&lt;&#x2F;strong&gt;: Se usi YunoHost per gestire il tuo server, i backup sono gestiti di default attraverso Borg. L&#x27;interfaccia web di YunoHost ti permette di configurare tutto con pochi click. Scegli la destinazione, inserisci i parametri (credenziali e url), e il sistema si occupa di tutto.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Nextcloud AIO (All-in-One)&lt;&#x2F;strong&gt;: Nextcloud AIO, il modo più moderno di deployare Nextcloud, ha integrato Borg come sistema di backup predefinito. Quando installi Nextcloud AIO, la possibilità di fare backup via Borg è già incorporata. Questo dovrebbe dirvi tutto quello che dovete sapere sulla fiducia che anche i principali progetti ripongono in Borg.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;borgmatic-quando-borg-diventa-semplice&quot;&gt;&lt;a class=&quot;header-anchor no-hover-padding&quot; href=&quot;#borgmatic-quando-borg-diventa-semplice&quot; aria-label=&quot;Anchor link for: borgmatic-quando-borg-diventa-semplice&quot;&gt;&lt;span class=&quot;link-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;&#x2F;span&gt;&lt;&#x2F;a&gt;
Borgmatic: Quando Borg Diventa Semplice&lt;&#x2F;h2&gt;
&lt;p&gt;Borg è fantastico, ma ha una curva di apprendimento. I comandi sono molti, le opzioni sono numerose, e ricordare tutti i parametri ogni volta è difficile. Qui entra in gioco Borgmatic.&lt;&#x2F;p&gt;
&lt;p&gt;Borgmatic è uno strato di semplificazione costruito sopra Borg. È un software che prende un file di configurazione (YAML, molto leggibile) e trasforma complessi flussi di backup in un singolo comando: &lt;code&gt;borgmatic&lt;&#x2F;code&gt;. Non solo, ma Borgmatic aggiunge funzionalità utili come le notifiche, la verifica automatica dei backup, il controllo della salute del repository e molto altro.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;img src=&quot;https:&#x2F;&#x2F;img.agostinelli.eu&#x2F;2026&#x2F;borgmatic.png&quot; alt=&quot;Borgmatic&quot; &#x2F;&gt;&lt;&#x2F;p&gt;
&lt;h3 id=&quot;configurare-borgmatic-un-esempio-pratico&quot;&gt;&lt;a class=&quot;header-anchor no-hover-padding&quot; href=&quot;#configurare-borgmatic-un-esempio-pratico&quot; aria-label=&quot;Anchor link for: configurare-borgmatic-un-esempio-pratico&quot;&gt;&lt;span class=&quot;link-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;&#x2F;span&gt;&lt;&#x2F;a&gt;
Configurare Borgmatic: Un Esempio Pratico&lt;&#x2F;h3&gt;
&lt;p&gt;Per iniziare con Borgmatic, installa il pacchetto:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;bash&quot; class=&quot;language-bash z-code&quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;pip&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; install&lt;span class=&quot;z-variable z-parameter z-option z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-parameter z-shell&quot;&gt; --&lt;&#x2F;span&gt;user&lt;&#x2F;span&gt; borgmatic&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Poi crea la directory di configurazione:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;bash&quot; class=&quot;language-bash z-code&quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;mkdir&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt;&lt;span class=&quot;z-variable z-parameter z-option z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-parameter z-shell&quot;&gt; -&lt;&#x2F;span&gt;p&lt;&#x2F;span&gt; &lt;span class=&quot;z-meta z-group z-expansion z-tilde&quot;&gt;&lt;span class=&quot;z-variable z-language z-tilde z-shell&quot;&gt;~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&#x2F;.config&#x2F;borgmatic&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;E un file di configurazione di base:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;yaml&quot; class=&quot;language-yaml z-code&quot;&gt;&lt;code class=&quot;language-yaml&quot; data-lang=&quot;yaml&quot;&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-yaml&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-comment z-line z-number-sign z-yaml&quot;&gt;#&lt;&#x2F;span&gt; Configurazione di Borgmatic - salva come ~&#x2F;.config&#x2F;borgmatic&#x2F;config.yaml
&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;&lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag z-yaml&quot;&gt;source_directories&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-key-value z-mapping z-yaml&quot;&gt;:&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;  &lt;span class=&quot;z-punctuation z-definition z-block z-sequence z-item z-yaml&quot;&gt;-&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&#x2F;home&#x2F;utente&#x2F;documenti&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;  &lt;span class=&quot;z-punctuation z-definition z-block z-sequence z-item z-yaml&quot;&gt;-&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&#x2F;home&#x2F;utente&#x2F;progetti&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;  &lt;span class=&quot;z-punctuation z-definition z-block z-sequence z-item z-yaml&quot;&gt;-&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&#x2F;etc&#x2F;&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;&lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag z-yaml&quot;&gt;repositories&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-key-value z-mapping z-yaml&quot;&gt;:&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;  &lt;span class=&quot;z-punctuation z-definition z-block z-sequence z-item z-yaml&quot;&gt;-&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag z-yaml&quot;&gt;label&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-key-value z-mapping z-yaml&quot;&gt;:&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;backup_principale&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;    &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag z-yaml&quot;&gt;path&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-key-value z-mapping z-yaml&quot;&gt;:&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&#x2F;mnt&#x2F;discoesterno&#x2F;backup&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;    &lt;span class=&quot;z-comment z-line z-number-sign z-yaml&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-comment z-line z-number-sign z-yaml&quot;&gt;#&lt;&#x2F;span&gt; Se vuoi un backup remoto SSH, usa questo:
&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;    &lt;span class=&quot;z-comment z-line z-number-sign z-yaml&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-comment z-line z-number-sign z-yaml&quot;&gt;#&lt;&#x2F;span&gt; path: ssh:&#x2F;&#x2F;utente@backup.example.com:22&#x2F;backups&#x2F;mio_server
&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;&lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag z-yaml&quot;&gt;retention&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-key-value z-mapping z-yaml&quot;&gt;:&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;  &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag z-yaml&quot;&gt;keep_daily&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-key-value z-mapping z-yaml&quot;&gt;:&lt;&#x2F;span&gt; &lt;span class=&quot;z-constant z-numeric z-integer z-decimal z-yaml&quot;&gt;7&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;  &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag z-yaml&quot;&gt;keep_weekly&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-key-value z-mapping z-yaml&quot;&gt;:&lt;&#x2F;span&gt; &lt;span class=&quot;z-constant z-numeric z-integer z-decimal z-yaml&quot;&gt;4&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;  &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag z-yaml&quot;&gt;keep_monthly&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-key-value z-mapping z-yaml&quot;&gt;:&lt;&#x2F;span&gt; &lt;span class=&quot;z-constant z-numeric z-integer z-decimal z-yaml&quot;&gt;12&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;  &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag z-yaml&quot;&gt;keep_yearly&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-key-value z-mapping z-yaml&quot;&gt;:&lt;&#x2F;span&gt; &lt;span class=&quot;z-constant z-numeric z-integer z-decimal z-yaml&quot;&gt;2&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;&lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag z-yaml&quot;&gt;checks&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-key-value z-mapping z-yaml&quot;&gt;:&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;  &lt;span class=&quot;z-punctuation z-definition z-block z-sequence z-item z-yaml&quot;&gt;-&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag z-yaml&quot;&gt;name&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-key-value z-mapping z-yaml&quot;&gt;:&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;repository&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;    &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag z-yaml&quot;&gt;frequency&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-key-value z-mapping z-yaml&quot;&gt;:&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;2 weeks&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;  &lt;span class=&quot;z-punctuation z-definition z-block z-sequence z-item z-yaml&quot;&gt;-&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag z-yaml&quot;&gt;name&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-key-value z-mapping z-yaml&quot;&gt;:&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;archives&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;    &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag z-yaml&quot;&gt;frequency&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-key-value z-mapping z-yaml&quot;&gt;:&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;4 weeks&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;&lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag z-yaml&quot;&gt;hooks&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-key-value z-mapping z-yaml&quot;&gt;:&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;  &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag z-yaml&quot;&gt;before_backup&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-key-value z-mapping z-yaml&quot;&gt;:&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;    &lt;span class=&quot;z-punctuation z-definition z-block z-sequence z-item z-yaml&quot;&gt;-&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;echo &amp;quot;Inizio backup a $(date)&amp;quot;&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;  &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag z-yaml&quot;&gt;after_backup&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-key-value z-mapping z-yaml&quot;&gt;:&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;    &lt;span class=&quot;z-punctuation z-definition z-block z-sequence z-item z-yaml&quot;&gt;-&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;echo &amp;quot;Backup completato con successo&amp;quot;&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;  &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag z-yaml&quot;&gt;on_error&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-key-value z-mapping z-yaml&quot;&gt;:&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;    &lt;span class=&quot;z-punctuation z-definition z-block z-sequence z-item z-yaml&quot;&gt;-&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;echo &amp;quot;ERRORE durante il backup!&amp;quot;&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Ora, per fare un backup completo, basta eseguire:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;bash&quot; class=&quot;language-bash z-code&quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;borgmatic&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Questo comando:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;Effettua il backup di tutti i directory elencati&lt;&#x2F;li&gt;
&lt;li&gt;Applica la deduplica e la compressione&lt;&#x2F;li&gt;
&lt;li&gt;Cifra tutto con la tua passphrase&lt;&#x2F;li&gt;
&lt;li&gt;Applica le politiche di retention (mantiene 7 backup giornalieri, 4 settimanali, etc.)&lt;&#x2F;li&gt;
&lt;li&gt;Verifica l&#x27;integrità del repository secondo il calendario definito&lt;&#x2F;li&gt;
&lt;li&gt;Esegue gli hook (comando prima e dopo il backup)&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h3 id=&quot;automazione-con-cron&quot;&gt;&lt;a class=&quot;header-anchor no-hover-padding&quot; href=&quot;#automazione-con-cron&quot; aria-label=&quot;Anchor link for: automazione-con-cron&quot;&gt;&lt;span class=&quot;link-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;&#x2F;span&gt;&lt;&#x2F;a&gt;
Automazione con Cron&lt;&#x2F;h3&gt;
&lt;p&gt;Ora che hai configurato Borgmatic, il passo logico è automatizzare il backup. Aggiungi una voce al crontab:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;bash&quot; class=&quot;language-bash z-code&quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;crontab&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt;&lt;span class=&quot;z-variable z-parameter z-option z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-parameter z-shell&quot;&gt; -&lt;&#x2F;span&gt;e&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;E aggiungi questa riga per eseguire il backup ogni giorno alle 02:00 di notte:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;bash&quot; class=&quot;language-bash z-code&quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;0&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; 2 &lt;span class=&quot;z-keyword z-operator z-regexp z-quantifier z-shell&quot;&gt;*&lt;&#x2F;span&gt; &lt;span class=&quot;z-keyword z-operator z-regexp z-quantifier z-shell&quot;&gt;*&lt;&#x2F;span&gt; &lt;span class=&quot;z-keyword z-operator z-regexp z-quantifier z-shell&quot;&gt;*&lt;&#x2F;span&gt; &#x2F;home&#x2F;utente&#x2F;.local&#x2F;bin&#x2F;borgmatic&lt;span class=&quot;z-variable z-parameter z-option z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-parameter z-shell&quot;&gt; -&lt;&#x2F;span&gt;c&lt;&#x2F;span&gt; &#x2F;home&#x2F;utente&#x2F;.config&#x2F;borgmatic&#x2F;config.yaml&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Se vuoi eseguire il backup ogni 6 ore:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;bash&quot; class=&quot;language-bash z-code&quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;0&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-keyword z-operator z-regexp z-quantifier z-shell&quot;&gt;*&lt;&#x2F;span&gt;&#x2F;6 &lt;span class=&quot;z-keyword z-operator z-regexp z-quantifier z-shell&quot;&gt;*&lt;&#x2F;span&gt; &lt;span class=&quot;z-keyword z-operator z-regexp z-quantifier z-shell&quot;&gt;*&lt;&#x2F;span&gt; &lt;span class=&quot;z-keyword z-operator z-regexp z-quantifier z-shell&quot;&gt;*&lt;&#x2F;span&gt; &#x2F;home&#x2F;utente&#x2F;.local&#x2F;bin&#x2F;borgmatic&lt;span class=&quot;z-variable z-parameter z-option z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-parameter z-shell&quot;&gt; -&lt;&#x2F;span&gt;c&lt;&#x2F;span&gt; &#x2F;home&#x2F;utente&#x2F;.config&#x2F;borgmatic&#x2F;config.yaml&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;h2 id=&quot;il-superpotere-di-borgmatic-i-database&quot;&gt;&lt;a class=&quot;header-anchor no-hover-padding&quot; href=&quot;#il-superpotere-di-borgmatic-i-database&quot; aria-label=&quot;Anchor link for: il-superpotere-di-borgmatic-i-database&quot;&gt;&lt;span class=&quot;link-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;&#x2F;span&gt;&lt;&#x2F;a&gt;
Il Superpotere di Borgmatic: I Database&lt;&#x2F;h2&gt;
&lt;p&gt;Se gestisci servizi come Nextcloud, Ghost o un qualsiasi stack LAMP&#x2F;LEMP, sai che salvare i file non basta: devi mettere al sicuro il &lt;strong&gt;database&lt;&#x2F;strong&gt;. Di solito questo significa scrivere uno script che fa il dump, lo salva in una cartella e poi Borg lo carica.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Borgmatic fa tutto da solo&lt;&#x2F;strong&gt;. Può collegarsi ai tuoi database, farne il &lt;em&gt;dump&lt;&#x2F;em&gt; &quot;al volo&quot; e inviarlo direttamente nel repository di backup senza sporcare il disco con file temporanei.&lt;&#x2F;p&gt;
&lt;p&gt;Ecco come aggiungere il supporto per i database nel tuo config.yaml:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;YAML&quot; class=&quot;language-YAML z-code&quot;&gt;&lt;code class=&quot;language-YAML&quot; data-lang=&quot;YAML&quot;&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;&lt;span class=&quot;z-comment z-line z-number-sign z-yaml&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-comment z-line z-number-sign z-yaml&quot;&gt;#&lt;&#x2F;span&gt; Aggiungi questo al tuo file di configurazione
&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;&lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag z-yaml&quot;&gt;databases&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-key-value z-mapping z-yaml&quot;&gt;:&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;  &lt;span class=&quot;z-punctuation z-definition z-block z-sequence z-item z-yaml&quot;&gt;-&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag z-yaml&quot;&gt;name&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-key-value z-mapping z-yaml&quot;&gt;:&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;nextcloud_db&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;    &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag z-yaml&quot;&gt;type&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-key-value z-mapping z-yaml&quot;&gt;:&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;postgresql&lt;&#x2F;span&gt; &lt;span class=&quot;z-comment z-line z-number-sign z-yaml&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-comment z-line z-number-sign z-yaml&quot;&gt;#&lt;&#x2F;span&gt; o mysql &#x2F; mariadb &#x2F; sqlite
&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;    &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag z-yaml&quot;&gt;username&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-key-value z-mapping z-yaml&quot;&gt;:&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;nextcloud_user&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;    &lt;span class=&quot;z-comment z-line z-number-sign z-yaml&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-comment z-line z-number-sign z-yaml&quot;&gt;#&lt;&#x2F;span&gt; Se il DB gira in un container, puoi specificarlo qui:
&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;    &lt;span class=&quot;z-comment z-line z-number-sign z-yaml&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-comment z-line z-number-sign z-yaml&quot;&gt;#&lt;&#x2F;span&gt; hostname: localhost 
&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;h3 id=&quot;perche-e-fondamentale-per-nextcloud&quot;&gt;&lt;a class=&quot;header-anchor no-hover-padding&quot; href=&quot;#perche-e-fondamentale-per-nextcloud&quot; aria-label=&quot;Anchor link for: perche-e-fondamentale-per-nextcloud&quot;&gt;&lt;span class=&quot;link-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;&#x2F;span&gt;&lt;&#x2F;a&gt;
Perché è fondamentale per Nextcloud?&lt;&#x2F;h3&gt;
&lt;p&gt;Nextcloud salva i metadati dei file, i contatti, i calendari e le configurazioni nel database. Se ripristini solo la cartella data ma non il database, ti ritroverai con un&#x27;istanza &quot;rotta&quot;. Con questa configurazione, Borgmatic:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Blocca (se necessario) e interroga il DB.&lt;&#x2F;li&gt;
&lt;li&gt;Trasmette il contenuto crittografato al volo.&lt;&#x2F;li&gt;
&lt;li&gt;Lo include nello stesso &quot;snapshot&quot; dei file.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;In caso di disastro, avrai la certezza matematica che i file e il database siano sincronizzati allo stesso identico istante, evitando &lt;em&gt;inconsistenze&lt;&#x2F;em&gt; che sono l&#x27;incubo di ogni sysadmin.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;notifiche-e-monitoraggio&quot;&gt;&lt;a class=&quot;header-anchor no-hover-padding&quot; href=&quot;#notifiche-e-monitoraggio&quot; aria-label=&quot;Anchor link for: notifiche-e-monitoraggio&quot;&gt;&lt;span class=&quot;link-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;&#x2F;span&gt;&lt;&#x2F;a&gt;
Notifiche e Monitoraggio&lt;&#x2F;h3&gt;
&lt;p&gt;Una delle feature migliori di Borgmatic è la capacità di avvisarti istantaneamente se un backup fallisce o se è andato a buon fine. Invece di controllare i log ogni mattina, io uso &lt;strong&gt;ntfy&lt;&#x2F;strong&gt;, un servizio di messaggistica pub-sub semplicissimo (e ovviamente self-hostabile).&lt;&#x2F;p&gt;
&lt;p&gt;Puoi configurare le notifiche direttamente nel tuo config.yaml. Ecco come inviare un messaggio al tuo telefono ogni volta che Borgmatic finisce il suo lavoro:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;YAML&quot; class=&quot;language-YAML z-code&quot;&gt;&lt;code class=&quot;language-YAML&quot; data-lang=&quot;YAML&quot;&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;&lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag z-yaml&quot;&gt;ntfy&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-key-value z-mapping z-yaml&quot;&gt;:&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;  &lt;span class=&quot;z-comment z-line z-number-sign z-yaml&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-comment z-line z-number-sign z-yaml&quot;&gt;#&lt;&#x2F;span&gt; L&amp;#39;URL del tuo server ntfy (o quello ufficiale)
&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;  &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag z-yaml&quot;&gt;topic&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-key-value z-mapping z-yaml&quot;&gt;:&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;il_tuo_topic_segreto&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;  &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag z-yaml&quot;&gt;server&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-key-value z-mapping z-yaml&quot;&gt;:&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;https:&#x2F;&#x2F;ntfy.sh&lt;&#x2F;span&gt; 
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;  &lt;span class=&quot;z-comment z-line z-number-sign z-yaml&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-comment z-line z-number-sign z-yaml&quot;&gt;#&lt;&#x2F;span&gt; Invia notifiche solo in caso di errore o sempre?
&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;  &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag z-yaml&quot;&gt;states&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-key-value z-mapping z-yaml&quot;&gt;:&lt;&#x2F;span&gt; &lt;span class=&quot;z-meta z-flow-sequence z-yaml&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-sequence z-begin z-yaml&quot;&gt;[&lt;&#x2F;span&gt;&lt;span class=&quot;z-string z-unquoted z-plain z-in z-yaml&quot;&gt;failed&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-sequence z-yaml&quot;&gt;,&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-unquoted z-plain z-in z-yaml&quot;&gt;finished&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-sequence z-end z-yaml&quot;&gt;]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;  &lt;span class=&quot;z-comment z-line z-number-sign z-yaml&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-comment z-line z-number-sign z-yaml&quot;&gt;#&lt;&#x2F;span&gt; Puoi anche aggiungere una priorità diversa in base allo stato
&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;  &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag z-yaml&quot;&gt;priority&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-key-value z-mapping z-yaml&quot;&gt;:&lt;&#x2F;span&gt; &lt;span class=&quot;z-constant z-numeric z-integer z-decimal z-yaml&quot;&gt;5&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Se invece preferisci usare i classici hooks per personalizzare il messaggio (magari includendo il nome dell&#x27;host), puoi fare così:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;YAML&quot; class=&quot;language-YAML z-code&quot;&gt;&lt;code class=&quot;language-YAML&quot; data-lang=&quot;YAML&quot;&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;&lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag z-yaml&quot;&gt;hooks&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-key-value z-mapping z-yaml&quot;&gt;:&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;  &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag z-yaml&quot;&gt;on_error&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-key-value z-mapping z-yaml&quot;&gt;:&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;    &lt;span class=&quot;z-punctuation z-definition z-block z-sequence z-item z-yaml&quot;&gt;-&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;curl -d &amp;quot;❌ Backup fallito su $(hostname)&amp;quot; https:&#x2F;&#x2F;ntfy.sh&#x2F;il_tuo_topic_segreto&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;  &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;&lt;span class=&quot;z-entity z-name z-tag z-yaml&quot;&gt;after_backup&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-separator z-key-value z-mapping z-yaml&quot;&gt;:&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-yaml&quot;&gt;    &lt;span class=&quot;z-punctuation z-definition z-block z-sequence z-item z-yaml&quot;&gt;-&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-unquoted z-plain z-out z-yaml&quot;&gt;curl -d &amp;quot;✅ Backup completato con successo su $(hostname)&amp;quot; https:&#x2F;&#x2F;ntfy.sh&#x2F;il_tuo_topic_segreto&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Con l&#x27;app di ntfy installata sullo smartphone, riceverai una notifica push in tempo reale. Se non vedi arrivare nulla, allora sai che c&#x27;è qualcosa da controllare.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;recuperare-i-dati-quando-il-backup-diventa-importante&quot;&gt;&lt;a class=&quot;header-anchor no-hover-padding&quot; href=&quot;#recuperare-i-dati-quando-il-backup-diventa-importante&quot; aria-label=&quot;Anchor link for: recuperare-i-dati-quando-il-backup-diventa-importante&quot;&gt;&lt;span class=&quot;link-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;&#x2F;span&gt;&lt;&#x2F;a&gt;
Recuperare i Dati: Quando il Backup Diventa Importante&lt;&#x2F;h2&gt;
&lt;p&gt;Tutto questo lavoro di backup è inutile se non puoi effettivamente recuperare i tuoi dati. Con Borg è sorprendentemente semplice.&lt;&#x2F;p&gt;
&lt;p&gt;Per elencare tutti i backup disponibili:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;bash&quot; class=&quot;language-bash z-code&quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;borg&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; list &#x2F;mnt&#x2F;discoesterno&#x2F;backup&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Per elencare i file all&#x27;interno di un backup specifico:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;bash&quot; class=&quot;language-bash z-code&quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;borg&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; list &#x2F;mnt&#x2F;discoesterno&#x2F;backup::backup_2025_01_15&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Per estrarre un singolo file:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;bash&quot; class=&quot;language-bash z-code&quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;borg&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; extract &#x2F;mnt&#x2F;discoesterno&#x2F;backup::backup_2025_01_15 &#x2F;home&#x2F;utente&#x2F;documenti&#x2F;importante.txt&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Per ripristinare l&#x27;intero backup in una directory temporanea:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;bash&quot; class=&quot;language-bash z-code&quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;mkdir&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &#x2F;tmp&#x2F;ripristino&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-support z-function z-cd z-shell&quot;&gt;cd&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &#x2F;tmp&#x2F;ripristino&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;borg&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; extract &#x2F;mnt&#x2F;discoesterno&#x2F;backup::backup_2025_01_15&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;La bellezza di Borg è che il ripristino è altrettanto semplice della creazione del backup. Non c&#x27;è magia incomprensibile, solo comandi diretti e intuitivi.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;le-limitazioni-che-non-sono-molte&quot;&gt;&lt;a class=&quot;header-anchor no-hover-padding&quot; href=&quot;#le-limitazioni-che-non-sono-molte&quot; aria-label=&quot;Anchor link for: le-limitazioni-che-non-sono-molte&quot;&gt;&lt;span class=&quot;link-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;&#x2F;span&gt;&lt;&#x2F;a&gt;
Le Limitazioni (Che Non Sono Molte)&lt;&#x2F;h2&gt;
&lt;p&gt;Borg è meraviglioso, ma non è perfetto. Vale la pena menzionare un paio di limitazioni:&lt;&#x2F;p&gt;
&lt;p&gt;Innanzitutto, per i database, Borg avrebbe bisogno di un dump preventivo su disco. Fortunatamente, come abbiamo visto, Borgmatic risolve il problema gestendo i dump al volo, ma è sempre bene verificare di avere abbastanza spazio temporaneo per queste operazioni se i database sono mastodontici.&lt;&#x2F;p&gt;
&lt;p&gt;In secondo luogo, la prima esecuzione di un backup remoto è lenta. Se hai 500 GB da inviare al tuo server di backup via SSH, i tempi saranno significativi. Ma i backup successivi saranno enormemente più veloci grazie alla deduplica. La &lt;em&gt;deduplica cross-archive&lt;&#x2F;em&gt; (tra diversi backup) significa che i cambiamenti incrementali sono davvero incrementali.&lt;&#x2F;p&gt;
&lt;p&gt;Infine, il ripristino di backup molto grandi con molti file può essere un po&#x27; lento, soprattutto se il repository è su un disco lento. Ma una volta che hai i dati localmente, sei a posto.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;conclusione-perche-ho-scelto-borg&quot;&gt;&lt;a class=&quot;header-anchor no-hover-padding&quot; href=&quot;#conclusione-perche-ho-scelto-borg&quot; aria-label=&quot;Anchor link for: conclusione-perche-ho-scelto-borg&quot;&gt;&lt;span class=&quot;link-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;&#x2F;span&gt;&lt;&#x2F;a&gt;
Conclusione: Perché Ho Scelto Borg&lt;&#x2F;h2&gt;
&lt;p&gt;Negli ultimi anni ho usato Borg su ogni server che amministro. A volte ho dovuto recuperare i dati, e ogni singola volta Borg c&#x27;è stato, puntuale e affidabile. Ha sempre ripristinato esattamente quello che mi serviva, senza cerimoniali inutili.&lt;&#x2F;p&gt;
&lt;p&gt;Borg è ciò che mi piace in un software: semplice nei concetti, potente nell&#x27;esecuzione, straordinariamente efficiente, e completamente open source. Borgmatic lo rende ancora più accessibile, anche per chi non vuole passare ore a studiare manuali complessi.&lt;&#x2F;p&gt;
&lt;p&gt;Se gestisci un server self-hosted, uno o più personal computer, o semplicemente dati che non puoi permetterti di perdere, Borg e Borgmatic meritano seriamente di essere nella tua cassetta degli attrezzi. Il tempo che dedicherai alla loro configurazione sarà tempo ben speso, e il giorno in cui avrai bisogno di recuperare un file eliminato accidentalmente, ringrazierai te stesso di averlo fatto.&lt;&#x2F;p&gt;
&lt;p&gt;Buon backup!&lt;&#x2F;p&gt;
</description>
      </item>
      <item>
          <title>Home Assistant rsync backup</title>
          <pubDate>Mon, 18 Dec 2023 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://www.agostinelli.eu/blog/home-assistant-rsync-backup/</link>
          <guid>https://www.agostinelli.eu/blog/home-assistant-rsync-backup/</guid>
          <description xml:base="https://www.agostinelli.eu/blog/home-assistant-rsync-backup/">&lt;p&gt;Ho scritto un plugin per home assistant!
Ma ce n&#x27;era davvero bisogno? Purtroppo si, perchè avevo una particolare necessità che sotto vi spiego.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;contesto&quot;&gt;&lt;a class=&quot;header-anchor no-hover-padding&quot; href=&quot;#contesto&quot; aria-label=&quot;Anchor link for: contesto&quot;&gt;&lt;span class=&quot;link-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;&#x2F;span&gt;&lt;&#x2F;a&gt;
Contesto&lt;&#x2F;h2&gt;
&lt;p&gt;A casa ho un NAS che tengo quasi sempre spento, e che accendono alla bisogna. Quando lo accendo, ci sono delle procedure&#x2F;software installati che partono e aggiornarnano i dati.
Avevo, quindi, la necessità di trovare una soluzione simile anche con #homeassistant. Ho provato vari plugin esistenti, ma nessuno faceva al caso mio.
Dato che implementare questo tipo di plugin sulla carta sembrava molto semplice, ho deciso, quasi per gioco, di scriverne uno.&lt;&#x2F;p&gt;
&lt;p&gt;Lo trovate qui: https:&#x2F;&#x2F;github.com&#x2F;magostinelli&#x2F;hassio-addons-rsync-key&lt;&#x2F;p&gt;
&lt;h3 id=&quot;cosa-fa&quot;&gt;&lt;a class=&quot;header-anchor no-hover-padding&quot; href=&quot;#cosa-fa&quot; aria-label=&quot;Anchor link for: cosa-fa&quot;&gt;&lt;span class=&quot;link-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;&#x2F;span&gt;&lt;&#x2F;a&gt;
Cosa fa?&lt;&#x2F;h3&gt;
&lt;p&gt;Sincronizza i backup locali con quelli remoti via ssh con scambio chiave (senza password).
Al primo avvio del componente aggiuntivo viene mostrata la chiave (pubblica) creata, tale chiave dovrà essere abilitata per l&#x27;accesso sul nas al percorso in cui vogliamo depositare la copia dei nostri backup.&lt;&#x2F;p&gt;
&lt;p&gt;Il plugin ha alcune opzioni di configurazione:&lt;&#x2F;p&gt;
&lt;p&gt;&lt;img src=&quot;https:&#x2F;&#x2F;img.agostinelli.eu&#x2F;2023&#x2F;home_rsync_conf.jpg&quot; alt=&quot;schermata di configurazione&quot; &#x2F;&gt;&lt;&#x2F;p&gt;
&lt;p&gt;E nella schermata dei log è possibile monitorare la sua ultima esecuzione.
&lt;img src=&quot;https:&#x2F;&#x2F;img.agostinelli.eu&#x2F;2023&#x2F;home_rsync_log.jpg&quot; alt=&quot;schermata di configurazione&quot; &#x2F;&gt;&lt;&#x2F;p&gt;
&lt;h3 id=&quot;come-lo-uso&quot;&gt;&lt;a class=&quot;header-anchor no-hover-padding&quot; href=&quot;#come-lo-uso&quot; aria-label=&quot;Anchor link for: come-lo-uso&quot;&gt;&lt;span class=&quot;link-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;&#x2F;span&gt;&lt;&#x2F;a&gt;
Come lo uso?&lt;&#x2F;h3&gt;
&lt;p&gt;Ho creato un automazione che fa partire questo componente aggiuntivo 1 minuto dopo aver rilevato che il mio nas è stato acceso.
Una volta che il componente avrà eseguito il suo lavoro si &lt;strong&gt;spengerà automaticamente&lt;&#x2F;strong&gt;, così il &lt;strong&gt;consumo&lt;&#x2F;strong&gt; di risorse è davvero &lt;strong&gt;inesistente&lt;&#x2F;strong&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;#homeassistant #hass #rsync #linux #backup #nas&lt;&#x2F;p&gt;
</description>
      </item>
    </channel>
</rss>
