{"id":743,"date":"2009-06-08T20:43:34","date_gmt":"2009-06-09T01:43:34","guid":{"rendered":"http:\/\/theholtsite.com\/blog\/?p=743"},"modified":"2009-06-08T20:43:34","modified_gmt":"2009-06-09T01:43:34","slug":"my-beautiful-remote-backup-script","status":"publish","type":"post","link":"https:\/\/theholtsite.com\/blog\/743\/","title":{"rendered":"My Beautiful Remote Backup Script"},"content":{"rendered":"<p>I spent a large part of last week writing a really cool off-site automated backup script.\u00a0 Coding looks easy sometimes but a single line can often take me hours of research and trial and error.\u00a0 It&#8217;s finished, and it&#8217;s beautiful.\u00a0 Here&#8217;s what it does:<\/p>\n<p>1) From a list of directories\u00a0 you want to back up, the script takes each one in turn.\u00a0 First it creates a disk image (.dmg) of the entire folder using hdiutil.\u00a0 This image is stored in a folder the script creates and is named according to the directory it is backing up.<\/p>\n<p>2) To avoid file size limitations on foreign servers, the disk image is segmented into 1GB chunks.\u00a0 Each part is encrypted.\u00a0 This was also done with hdiutil.<\/p>\n<p>3) The entire folder (now in encrypted segments) is queued for upload via FTP using ncftpput, a very handy script tool.<\/p>\n<p>4) To avoid space limitations on the local drive, the script waits until the entire directory is uploaded.\u00a0 It then deletes the disk images and moves on to the next folder in the list.<\/p>\n<p>It was working flawlessly, although FTP&#8217;ing many gigabytes takes days when your upload speed is around 300 KB\/s.\u00a0 I also throttled the bandwidth of ncftpput to 200 so I could do other stuff on my connection while it ran in the background.<\/p>\n<p>The problem came when my host shut my entire account down.\u00a0 Apparently they don&#8217;t like you using their space for anything other than web-related files.\u00a0 A pity, as I have terabytes of space available to me.<\/p>\n<p>So I&#8217;m left with a beautiful, functional remote backup script with no off-site backups \ud83d\ude41<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I spent a large part of last week writing a really cool off-site automated backup script.\u00a0 Coding looks easy sometimes but a single line can often take me hours of research and trial and error.\u00a0 It&#8217;s finished, and it&#8217;s beautiful.\u00a0 Here&#8217;s what it does: 1) From a list of directories\u00a0 you want to back up, [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-743","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/theholtsite.com\/blog\/wp-json\/wp\/v2\/posts\/743","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/theholtsite.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/theholtsite.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/theholtsite.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/theholtsite.com\/blog\/wp-json\/wp\/v2\/comments?post=743"}],"version-history":[{"count":0,"href":"https:\/\/theholtsite.com\/blog\/wp-json\/wp\/v2\/posts\/743\/revisions"}],"wp:attachment":[{"href":"https:\/\/theholtsite.com\/blog\/wp-json\/wp\/v2\/media?parent=743"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/theholtsite.com\/blog\/wp-json\/wp\/v2\/categories?post=743"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/theholtsite.com\/blog\/wp-json\/wp\/v2\/tags?post=743"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}