{"id":306,"date":"2009-09-21T02:56:37","date_gmt":"2009-09-21T07:56:37","guid":{"rendered":"http:\/\/yourlinuxguy.com\/?p=306"},"modified":"2009-09-24T14:18:59","modified_gmt":"2009-09-24T19:18:59","slug":"near-line-data-backups-with-rdiff-backup","status":"publish","type":"post","link":"https:\/\/yourLinuxGuy.com\/?p=306","title":{"rendered":"Near-line Data Backups With RDiff-Backup"},"content":{"rendered":"<p>Backups are great.\u00a0 Yes, I&#8217;m <em>that<\/em> guy that loves backups.\u00a0 Of course everyone uses an off-line, off-site backup system like <a title=\"http:\/\/jungledisk.com\/\" href=\"http:\/\/jungledisk.com\/\" target=\"_blank\">JungleDisk<\/a>, right?\u00a0 Or if you&#8217;re lucky enough to have your own personal cloud, then you&#8217;ve got that covered from that angle&#8230;<\/p>\n<p>But what about near-line backups, where you can rapidly restore data (like in the case of corruption or accidental deletion) without going through the work of remote restores?\u00a0 For this type of backup and restore, I like &#8220;<code>rdiff-backup<\/code>&#8220;.\u00a0 It is a tool that can be used many ways, but in the most basic use, will create a duplicated data structure &#8212; with metadata &#8212; for tracking time-based changes for the benefit of a time-based restore.\u00a0 Sounds like that one well-known Mac tool, eh&#8230;?<\/p>\n<p>To use <code>rdiff-backup<\/code>, you need to find it in your favorite Linux distribution and install the package.\u00a0 Bam.\u00a0 Then you use it.\u00a0 Bam.\u00a0 That easy.\u00a0 But <em>how<\/em> do you use it?\u00a0 Glad you asked&#8230;<\/p>\n<p>Here are a few examples where I backup, compare, or restore data from my <code>\/home<\/code> directory to <code>\/home.backup<\/code> (note that the <code>\/home.backup<\/code> directory is owned and controlled by the <code>rdiff-backup<\/code> tool&#8217;s tracking mechanism) :<\/p>\n<p>Here&#8217;s an example to run nightly, like from a cron job or something:<br \/>\n<code>rdiff-backup \/home \/home.backup<\/code><br \/>\n&#8230;or, with exclusions and a higher verbosity level&#8230;<br \/>\n<code>rdiff-backup -v5 --exclude \"\/home\/jpavlov\/Photos\" --exclude \"\/home\/jpavlov\/iFolder\" --exclude \"\/home\/jpavlov\/windowsStuff\" --exclude \"\/home\/jpavlov\/.beagle\" \/home \/home.backup<\/code><\/p>\n<p>Handy tip:<br \/>\n<code>rdiff-backup --compare \/home \/home.backup<\/code><br \/>\n&#8230;or again, more specifically&#8230;<br \/>\n<code>rdiff-backup --exclude \"\/home\/jpavlov\/Photos\" --exclude \"\/home\/jpavlov\/iFolder\" --exclude \"\/home\/jpavlov\/windowsStuff\" --exclude \"\/home\/jpavlov\/.beagle\" --compare \/home \/home.backup<\/code><\/p>\n<p>To see the backups available from which to choose:<br \/>\n<code>rdiff-backup -l \/home.backup\/<\/code><\/p>\n<p>To restore to an alternate target:<br \/>\n<code>rdiff-backup -v9 --restore-as-of \"now\" \/home.backup \/home.old\/<\/code><br \/>\n&#8230;or&#8230;<br \/>\n<code>rdiff-backup -v9 --restore-as-of \"2008-01-20T19:39:51-05:00\" \/home.backup \/home.old\/<\/code><\/p>\n<p>A couple notes here&#8230; of course, if you happen to have an encrypted <code>\/home<\/code> folder (ahem), you don&#8217;t want to backup the folder out to a non-encrypted space, so be mindful of things like that.\u00a0 And read the man pages, and <a title=\"http:\/\/www.nongnu.org\/rdiff-backup\/index.html\" href=\"http:\/\/www.nongnu.org\/rdiff-backup\/index.html\" target=\"_blank\">the main site<\/a>, which is filled with good docs and good examples&#8230;<\/p>\n<p>Enjoy!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Backups are great.\u00a0 Yes, I&#8217;m that guy that loves backups.\u00a0 Of course everyone uses an off-line, off-site backup system like JungleDisk, right?\u00a0 Or if you&#8217;re lucky enough to have your own personal cloud, then you&#8217;ve got that covered from that&#8230;<br \/><a class=\"read-more-button\" href=\"https:\/\/yourLinuxGuy.com\/?p=306\">Read more<\/a><\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[11,78],"tags":[],"class_list":["post-306","post","type-post","status-publish","format-standard","hentry","category-intermediate","category-rdiff-backup"],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/pnjn1-4W","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/yourLinuxGuy.com\/index.php?rest_route=\/wp\/v2\/posts\/306","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/yourLinuxGuy.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/yourLinuxGuy.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/yourLinuxGuy.com\/index.php?rest_route=\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/yourLinuxGuy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=306"}],"version-history":[{"count":3,"href":"https:\/\/yourLinuxGuy.com\/index.php?rest_route=\/wp\/v2\/posts\/306\/revisions"}],"predecessor-version":[{"id":309,"href":"https:\/\/yourLinuxGuy.com\/index.php?rest_route=\/wp\/v2\/posts\/306\/revisions\/309"}],"wp:attachment":[{"href":"https:\/\/yourLinuxGuy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=306"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/yourLinuxGuy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=306"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/yourLinuxGuy.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=306"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}