{"id":541,"date":"2008-09-21T22:55:47","date_gmt":"2008-09-22T05:55:47","guid":{"rendered":"http:\/\/www.elbeno.com\/blog\/?p=541"},"modified":"2008-09-21T23:02:36","modified_gmt":"2008-09-22T06:02:36","slug":"dreamhost-backups-the-appropriate-incantation","status":"publish","type":"post","link":"https:\/\/www.elbeno.com\/blog\/?p=541","title":{"rendered":"Dreamhost backups: the appropriate incantation"},"content":{"rendered":"<p>Recently, and without much fanfare, <a href=\"http:\/\/www.dreamhost.com\/\">Dreamhost<\/a> introduced backup users. Each account gets a single backup user, whose function is to provide a remote backup. Dreamhost&#8217;s TOS states that regular user content must be served on the web: it is not intended to be a backup service. However, clearly the need for remote backups exists, and so they now allow 50GB (plus more at the rate of $0.10 per GB per month) of backup space for each account, accessed through the backup user.<\/p>\n<p>So I&#8217;m backing up my email remotely. Just the job for a shell script. First things first: what do I need to backup? Well I use <a href=\"http:\/\/en.wikipedia.org\/wiki\/Evolution_(software)\">Evolution<\/a> for email, and first I need to stop things from changing while I backup, and make sure I&#8217;m starting from the right place:<\/p>\n<pre>gconftool-2 --shutdown\r\nevolution --force-shutdown\r\ncd<\/pre>\n<p>Next, I need to backup three directories, and encrypt them of course. (The recipient here is changed for security purposes.)<\/p>\n<pre>tar -cz .gconf\/apps\/evolution .gnome2_private\/Evolution .evolution \r\n    | gpg -e -r me@example.com -o mail.tar.gz.gpg<\/pre>\n<p>Now of course I need to upload the backup to the dreamhost backup server via <a href=\"http:\/\/en.wikipedia.org\/wiki\/SSH_file_transfer_protocol\">SFTP<\/a> (Once again the username here is changed for security purposes.):<\/p>\n<pre>sftp -b \/dev\/stdin mybackupusername@example.com &lt;&lt;EOF\r\nput mail.tar.gz.gpg\r\nbye\r\nEOF<\/pre>\n<p>And finally remove the intermediate file:<\/p>\n<pre>rm mail.tar.gz.gpg<\/pre>\n<p>Having previously uploaded my authorized ssh key to avoid having to type a password, of course, this process is now automated. The only fly in the ointment is that Dreamhost backup users only support FTP or SFTP; ideally they&#8217;d have support for rsync.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Recently, and without much fanfare, Dreamhost introduced backup users. Each account gets a single backup user, whose function is to provide a remote backup. Dreamhost&#8217;s TOS states that regular user content must be served on the web: it is not intended to be a backup service. However, clearly the need&#8230;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-541","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/www.elbeno.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/541","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.elbeno.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.elbeno.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.elbeno.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.elbeno.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=541"}],"version-history":[{"count":6,"href":"https:\/\/www.elbeno.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/541\/revisions"}],"predecessor-version":[{"id":547,"href":"https:\/\/www.elbeno.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/541\/revisions\/547"}],"wp:attachment":[{"href":"https:\/\/www.elbeno.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=541"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.elbeno.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=541"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.elbeno.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=541"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}