{"id":44,"date":"2018-04-10T16:31:42","date_gmt":"2018-04-10T14:31:42","guid":{"rendered":"https:\/\/ubuntu.dirkschmidtke.de\/?post_type=portfolio&#038;p=44"},"modified":"2024-12-25T15:33:31","modified_gmt":"2024-12-25T14:33:31","slug":"deja-dup","status":"publish","type":"portfolio","link":"https:\/\/ubuntu.dirkschmidtke.de\/en\/portfolio\/deja-dup\/","title":{"rendered":"D\u00e9j\u00e0 Dup Backups"},"content":{"rendered":"<p>Depending on the version and flavour, Ubuntu comes pre-installed with a backup utility, which can be found by typing &#8220;Backups&#8221; into the Gnome Shell search. However, its real name is <a href=\"https:\/\/launchpad.net\/deja-dup\" target=\"_blank\" rel=\"noopener noreferrer\">D\u00e9j\u00e0 Dup<\/a>, and it is <em>\u201conly\u201d<\/em> a graphical front-end for the mighty command line utility <a title=\"Zur Homepage\" href=\"http:\/\/duplicity.nongnu.org\/\" target=\"_blank\" rel=\"noopener noreferrer\">Duplicity<\/a>, which uses Rar und Gzip (compressed archives) as well as GnuPG (Data encryption). This is the foundation to configure incremental, compressed and encrypted backups to local (hard disk, burned cd or dvd) or remote (FTP, SSH, Samba shares, WebDav, cloud storage) destinations.<\/p>\n<p>Sounds complicated, but thanks to the simplicity of D\u00e9j\u00e0 Dup&#8217;s interface, it is really easy. Following the <em>&#8220;set and forget&#8221;<\/em> priciple, you configure the directories to be backed up once and then let D\u00e9j\u00e0 Dup perform a backup run every day. The scheduling is taken care of by its own monitoring service, not Cron, as the developers assume that the PC or laptop to be backed up is not running 24 hours a day. If you don&#8217;t want that or want a more fine-grained backup plan, you have to disable the built-in scheduling altogether.<\/p>\n<h3>A backup solution for the home folder, not for the entire system<\/h3>\n<p>By default, D\u00e9j\u00e0 Dup offers to back up the contents of your home folder, which is generally a smart choice. At the same time, one should not forget to exclude any folders, that have no real value for a backup but consume a lot of space. Typical candidates are the Trash as well as application file caches, which can be found in the hidden .cache directrory on the Gnome desktop.<\/p>\n<p>D\u00e9j\u00e0 Dup does not run with root rights, but with the rights of the user, so it is not suitable for backing up system files. If a file or folder cannot be saved because the access rights are missing, then D\u00e9j\u00e0 Dup reports an error message &#8211; every day, as long as you do not adjust the rights for this particluar file or exempt it from the backup. Otherwise, D\u00e9j\u00e0 Dup remains completely calm and only occasionally asks for the encryption password stored in the Gnome keyring to perform a test run.<\/p>\n<h3>Encrypted and incrementally<\/h3>\n<p>One should not forget the password for God&#8217;s sake &#8211; otherwise the data is lost, since the backups are stored in encrypted archive files, which don&#8217;t even give information about the folder structure and file names they contain. Therefore, you can also back up your data in a foreign cloud with a clear conscience &#8211; with the restriction that GPG does not enable forward secrecy, so that a thief who gets hold of the data AND sooner or later also captures the key can decrypt everything if he knows the password.<\/p>\n<p>Storing backups <em>&#8220;incrementally&#8221;<\/em> means that only the first run and each subsequent full backup are time-consuming. In between, only changes to the latest state are saved. This is fast, saves space and conserves bandwidth when transferring data to remote servers. However, this also means that restoring the data is more time-consuming and takes longer because of the reconstruction of the data from the backup chain, including decompression and decryption. If the chain were to break &#8211; for example, due to a defective sector on the hard disk of the backup target &#8211; then all subsequent incremental backups would be lost. Hence the test runs performed by D\u00e9j\u00e0 Dup from time to time to ensure the integrity of the backup data.<\/p>\n<h3>How to restore backups<\/h3>\n<p>The menu item &#8220;Restore&#8221; allows to choose files or directories from the backup for restoration. By selecting the date, you can specifically retrieve an older version. Before version 42, D\u00e9j\u00e0 Dup still had an integration for the Gnome desktop, so that you could start the restoration directly via right-click from the file manager Nautilus, which was more comfortable for Gnome users. However, the developers have removed this integration in favor of the integrated file view accessible via the menu item<em> &#8220;Restore&#8221;<\/em>, so that D\u00e9j\u00e0 Dup now feels equally at home on all desktops. In newer versions of D\u00e9j\u00e0 Dup, you may choose, whether a file shall be restored to its original location (be careful: this replaces the actual file with the older version from the backup) or to another location of your choice.<\/p>\n<p>Once again: To restore your data, you cannot simply copy it back, but only reconstruct it using D\u00e9j\u00e0 Dup. For more complicated usecases one has to turn to Duplicity on the command line. For example, if you want to delete all backup sets older than two month because your backup storage is running out of space:<\/p>\n<blockquote>\n<pre>duplicity remove-older-than 2M file:\/\/\/full-path-to-storage<\/pre>\n<\/blockquote>\n<p>In the unlikely case of a pressure loss in the cabin &#8230; pardon: In the unlikely case that D\u00e9j\u00e0 Dup can&#8217;t restore the data despite the correct password, there is an emergency solution. In short: First decrypt with GnuPG, then unpack the archives and let it restore the individual files. The long version can be found in the Gnome Wiki: <a href=\"https:\/\/wiki.gnome.org\/Apps\/DejaDup\/Help\/Restore\/WorstCase\" target=\"_blank\" rel=\"noopener noreferrer\">When everything goes wrong<\/a>.<\/p>\n<h3>How to install D\u00e9j\u00e0 Dup<\/h3>\n<p>If D\u00e9j\u00e0 Dup is not pre-installed in your Ubuntu flavour, it&#8217;s easy to do so:<\/p>\n<pre>sudo apt install deja-dup<\/pre>\n<p>If you use the Mate Desktop, an integration for the file manager, Caja, is available in the Universe Repository:<\/p>\n<pre>sudo apt install deja-dup-caja<\/pre>\n<h3>Alternatives to D\u00e9j\u00e0 Dup<\/h3>\n<p><a href=\"https:\/\/github.com\/bit-team\/backintime\" target=\"_blank\" rel=\"noopener noreferrer\">Back in Time<\/a> is a simple backup solution inspired by Apple&#8217;s Time Machine. It does not use compressed archives, so that files and folders may be copied directly from the backup. <a href=\"https:\/\/www.borgbackup.org\/\" target=\"_blank\" rel=\"noopener\">BorgBackup<\/a> is a comprehensive, fast and well supported backup software for Linux, PS-X and BSDs, which supports deduplication and optionally compression to save space and creates encrypted backups.<\/p>","protected":false},"excerpt":{"rendered":"<p>Depending on the version and flavour, Ubuntu comes pre-installed with a backup utility, which can be found by typing &#8220;Backups&#8221; into the Gnome Shell search. However, its real name is D\u00e9j\u00e0 Dup, and it is \u201conly\u201d a graphical front-end for the mighty command line utility Duplicity, which uses Rar und Gzip (compressed archives) as well [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":176,"comment_status":"open","ping_status":"closed","template":"","meta":{"footnotes":""},"portfolio_category":[4],"portfolio_tag":[],"class_list":["post-44","portfolio","type-portfolio","status-publish","has-post-thumbnail","hentry","portfolio_category-backup"],"_links":{"self":[{"href":"https:\/\/ubuntu.dirkschmidtke.de\/en\/wp-json\/wp\/v2\/portfolio\/44","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ubuntu.dirkschmidtke.de\/en\/wp-json\/wp\/v2\/portfolio"}],"about":[{"href":"https:\/\/ubuntu.dirkschmidtke.de\/en\/wp-json\/wp\/v2\/types\/portfolio"}],"author":[{"embeddable":true,"href":"https:\/\/ubuntu.dirkschmidtke.de\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ubuntu.dirkschmidtke.de\/en\/wp-json\/wp\/v2\/comments?post=44"}],"version-history":[{"count":17,"href":"https:\/\/ubuntu.dirkschmidtke.de\/en\/wp-json\/wp\/v2\/portfolio\/44\/revisions"}],"predecessor-version":[{"id":904,"href":"https:\/\/ubuntu.dirkschmidtke.de\/en\/wp-json\/wp\/v2\/portfolio\/44\/revisions\/904"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ubuntu.dirkschmidtke.de\/en\/wp-json\/wp\/v2\/media\/176"}],"wp:attachment":[{"href":"https:\/\/ubuntu.dirkschmidtke.de\/en\/wp-json\/wp\/v2\/media?parent=44"}],"wp:term":[{"taxonomy":"portfolio_category","embeddable":true,"href":"https:\/\/ubuntu.dirkschmidtke.de\/en\/wp-json\/wp\/v2\/portfolio_category?post=44"},{"taxonomy":"portfolio_tag","embeddable":true,"href":"https:\/\/ubuntu.dirkschmidtke.de\/en\/wp-json\/wp\/v2\/portfolio_tag?post=44"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}