{"id":242,"date":"2025-09-18T11:46:01","date_gmt":"2025-09-18T11:46:01","guid":{"rendered":"https:\/\/linuxbase.io\/?p=242"},"modified":"2025-09-18T11:46:01","modified_gmt":"2025-09-18T11:46:01","slug":"opnsense-mit-dirvish-sichern-einfach-erklart","status":"publish","type":"post","link":"https:\/\/netguide.io\/linux\/de\/opnsense-mit-dirvish-sichern-einfach-erklart\/","title":{"rendered":"OpnSense mit Dirvish sichern &#8211; einfach erkl\u00e4rt"},"content":{"rendered":"\n<p>Backups sind essenziell, besonders bei Firewalls wie OpnSense. Ein bew\u00e4hrtes Tool daf\u00fcr ist <strong>Dirvish<\/strong> &#8211; ein schlankes, automatisiertes Backup-System, das auf <strong>rsync<\/strong> basiert. Dirvish legt Snapshots an und kann alte Versionen automatisch l\u00f6schen, sodass man jederzeit auf fr\u00fchere Konfigurationen zur\u00fcckgreifen kann.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Was sichern?<\/h4>\n\n\n\n<p>Bei OpnSense ist oft nur das <strong><code>\/conf\/<\/code>-Verzeichnis<\/strong> wirklich wichtig, da hier alle Einstellungen der Firewall gespeichert werden. Ein vollst\u00e4ndiges System-Backup ist zwar m\u00f6glich, aber f\u00fcr die meisten Anwender gen\u00fcgt das Sichern dieses Verzeichnisses.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Vorbereitung: rsync und SSH-Key<\/h4>\n\n\n\n<p>Damit Dirvish die Backups automatisch abholen kann, muss <a href=\"https:\/\/netguide.io\/linux\/de\/opnsense-rsync-installieren\/\"><strong>rsync<\/strong> auf OpnSense installiert sein<\/a>. Au\u00dferdem sollte ein <strong>SSH-Key<\/strong> hinterlegt werden, damit der Backup-Server sich ohne Passwort anmelden kann. Eine Schritt-f\u00fcr-Schritt-Anleitung zur Einrichtung des SSH-Keys findest du <a href=\"https:\/\/humanize-ai.click\/#\">hier<\/a>.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Beispiel: Dirvish Config f\u00fcr OpnSense<\/h4>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2\"><span style=\"padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#24292e\"><\/span><span role=\"button\" style=\"color:#e1e4e8\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" aria-hidden=\"true\" readonly>client: root@192.168.8.6\nrsh: \/usr\/bin\/ssh\n\n# nur das Verzeichnis \/conf sichern\ntree: \/conf\/\n\nxdev: 0\n\nexpire default: +5 days\nexpire-rule:\n        *   00-23 *   *         1    +8 weeks\n        *   00-23 *   *         2-6  +7 days\n<\/textarea><\/pre><\/span><pre class=\"shiki github-dark\" style=\"background-color: #24292e\"><code><span class=\"line\"><span style=\"color: #B392F0\">client:<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #9ECBFF\">root@192.168.8.6<\/span><\/span>\n<span class=\"line\"><span style=\"color: #B392F0\">rsh:<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #9ECBFF\">\/usr\/bin\/ssh<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #6A737D\"># nur das Verzeichnis \/conf sichern<\/span><\/span>\n<span class=\"line\"><span style=\"color: #B392F0\">tree:<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #9ECBFF\">\/conf\/<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #B392F0\">xdev:<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #79B8FF\">0<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #B392F0\">expire<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #9ECBFF\">default:<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #9ECBFF\">+5<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #9ECBFF\">days<\/span><\/span>\n<span class=\"line\"><span style=\"color: #B392F0\">expire-rule:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">        <\/span><span style=\"color: #B392F0\">*<\/span><span style=\"color: #E1E4E8\">   <\/span><span style=\"color: #79B8FF\">00<\/span><span style=\"color: #9ECBFF\">-23<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #79B8FF\">*<\/span><span style=\"color: #E1E4E8\">   <\/span><span style=\"color: #79B8FF\">*<\/span><span style=\"color: #E1E4E8\">         <\/span><span style=\"color: #79B8FF\">1<\/span><span style=\"color: #E1E4E8\">    <\/span><span style=\"color: #9ECBFF\">+8<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #9ECBFF\">weeks<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">        <\/span><span style=\"color: #B392F0\">*<\/span><span style=\"color: #E1E4E8\">   <\/span><span style=\"color: #79B8FF\">00<\/span><span style=\"color: #9ECBFF\">-23<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #79B8FF\">*<\/span><span style=\"color: #E1E4E8\">   <\/span><span style=\"color: #79B8FF\">*<\/span><span style=\"color: #E1E4E8\">         <\/span><span style=\"color: #79B8FF\">2<\/span><span style=\"color: #9ECBFF\">-6<\/span><span style=\"color: #E1E4E8\">  <\/span><span style=\"color: #9ECBFF\">+7<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #9ECBFF\">days<\/span><\/span>\n<span class=\"line\"><\/span><\/code><\/pre><\/div>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>Erkl\u00e4rung der wichtigsten Punkte:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>client<\/code>: Adresse des OpnSense-Ger\u00e4ts<\/li>\n\n\n\n<li><code>rsh<\/code>: Pfad zu SSH f\u00fcr die Verbindung<\/li>\n\n\n\n<li><code>tree<\/code>: das zu sichernde Verzeichnis (<code>\/conf\/<\/code>)<\/li>\n\n\n\n<li><code>expire<\/code>: Regeln zur automatischen L\u00f6schung alter Backups<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">Backup initialisieren<\/h4>\n\n\n\n<p>Bevor Dirvish regelm\u00e4\u00dfig Snapshots erstellt, muss das Backup-Verzeichnis einmal initialisiert werden. Daf\u00fcr nutzt man:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2\"><span style=\"padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#24292e\"><\/span><span role=\"button\" style=\"color:#e1e4e8\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" aria-hidden=\"true\" readonly>dirvish --vault --init\n<\/textarea><\/pre><\/span><pre class=\"shiki github-dark\" style=\"background-color: #24292e\"><code><span class=\"line\"><span style=\"color: #B392F0\">dirvish<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #79B8FF\">--vault<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #79B8FF\">--init<\/span><\/span>\n<span class=\"line\"><\/span><\/code><\/pre><\/div>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>--vault<\/code> bereitet das Backup-Verzeichnis korrekt vor<\/li>\n\n\n\n<li><code>--init<\/code> erstellt den ersten Snapshot und legt die Struktur f\u00fcr zuk\u00fcnftige Backups an<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">Automatisches Backup mit Cron<\/h4>\n\n\n\n<p>Damit das Backup regelm\u00e4\u00dfig l\u00e4uft, kann man einen <strong>Cron-Job<\/strong> einrichten. Zum Beispiel t\u00e4glich um 02:00 Uhr:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2\"><span style=\"padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#24292e\"><\/span><span role=\"button\" style=\"color:#e1e4e8\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" aria-hidden=\"true\" readonly>0 2 * * * \/usr\/bin\/dirvish --vault --backup\n<\/textarea><\/pre><\/span><pre class=\"shiki github-dark\" style=\"background-color: #24292e\"><code><span class=\"line\"><span style=\"color: #B392F0\">0<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #79B8FF\">2<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #79B8FF\">*<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #79B8FF\">*<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #79B8FF\">*<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #9ECBFF\">\/usr\/bin\/dirvish<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #79B8FF\">--vault<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #79B8FF\">--backup<\/span><\/span>\n<span class=\"line\"><\/span><\/code><\/pre><\/div>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>0 2 * * *<\/code> \u2192 startet den Job jeden Tag um 02:00 Uhr<\/li>\n\n\n\n<li><code>--backup<\/code> \u2192 erstellt einen neuen Snapshot auf Basis der Konfiguration<\/li>\n<\/ul>\n\n\n\n<p>So l\u00e4uft das Backup automatisch im Hintergrund, und du musst dich nicht mehr darum k\u00fcmmern. Alte Versionen werden nach den Regeln in der <code>expire-rule<\/code> automatisch gel\u00f6scht.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Backups sind essenziell, besonders bei Firewalls wie OpnSense. Ein bew\u00e4hrtes Tool daf\u00fcr ist Dirvish &#8211; ein schlankes, automatisiertes Backup-System, das [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":296,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_uag_custom_page_level_css":"","site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"disabled","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[200],"tags":[39,75,53,202,208],"class_list":["post-242","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-opnsense","tag-backup","tag-dirvish","tag-firewall","tag-opnsense","tag-sicherung"],"uagb_featured_image_src":{"full":["https:\/\/netguide.io\/linux\/wp-content\/uploads\/sites\/2\/2025\/09\/opnsense-linuxbase.png",1920,1080,false],"thumbnail":["https:\/\/netguide.io\/linux\/wp-content\/uploads\/sites\/2\/2025\/09\/opnsense-linuxbase-150x150.png",150,150,true],"medium":["https:\/\/netguide.io\/linux\/wp-content\/uploads\/sites\/2\/2025\/09\/opnsense-linuxbase-300x169.png",300,169,true],"medium_large":["https:\/\/netguide.io\/linux\/wp-content\/uploads\/sites\/2\/2025\/09\/opnsense-linuxbase-768x432.png",768,432,true],"large":["https:\/\/netguide.io\/linux\/wp-content\/uploads\/sites\/2\/2025\/09\/opnsense-linuxbase-1024x576.png",1024,576,true],"1536x1536":["https:\/\/netguide.io\/linux\/wp-content\/uploads\/sites\/2\/2025\/09\/opnsense-linuxbase-1536x864.png",1536,864,true],"2048x2048":["https:\/\/netguide.io\/linux\/wp-content\/uploads\/sites\/2\/2025\/09\/opnsense-linuxbase.png",1920,1080,false]},"uagb_author_info":{"display_name":"tobias.pries","author_link":"https:\/\/netguide.io\/linux\/author\/tobias-pries\/"},"uagb_comment_info":0,"uagb_excerpt":"Backups sind essenziell, besonders bei Firewalls wie OpnSense. Ein bew\u00e4hrtes Tool daf\u00fcr ist Dirvish &#8211; ein schlankes, automatisiertes Backup-System, das [&hellip;]","_links":{"self":[{"href":"https:\/\/netguide.io\/linux\/wp-json\/wp\/v2\/posts\/242","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/netguide.io\/linux\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/netguide.io\/linux\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/netguide.io\/linux\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/netguide.io\/linux\/wp-json\/wp\/v2\/comments?post=242"}],"version-history":[{"count":0,"href":"https:\/\/netguide.io\/linux\/wp-json\/wp\/v2\/posts\/242\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/netguide.io\/linux\/wp-json\/wp\/v2\/media\/296"}],"wp:attachment":[{"href":"https:\/\/netguide.io\/linux\/wp-json\/wp\/v2\/media?parent=242"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/netguide.io\/linux\/wp-json\/wp\/v2\/categories?post=242"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/netguide.io\/linux\/wp-json\/wp\/v2\/tags?post=242"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}