{"id":518,"date":"2010-03-15T01:04:00","date_gmt":"2010-03-15T06:04:00","guid":{"rendered":"http:\/\/yourLinuxGuy.com\/?p=518"},"modified":"2010-03-15T06:52:06","modified_gmt":"2010-03-15T11:52:06","slug":"edirectory-backup-restore-cheat-sheet","status":"publish","type":"post","link":"https:\/\/yourLinuxGuy.com\/?p=518","title":{"rendered":"eDirectory Backup \/ Restore Cheat-Sheet"},"content":{"rendered":"<p>Here&#8217;s a quick cheat-sheet on how to do fast backup of your eDirectory tree from an OES Linux server.\u00a0 While we&#8217;re at it, we&#8217;ll do a quick restore of an object.<\/p>\n<p>First, let&#8217;s back it up!\u00a0 Let&#8217;s grab the whole tree:<\/p>\n<pre><code>ndsbackup cvf \/tmp\/ndsbackup-treeRoot.bak [Root]<\/code><\/pre>\n<p>&#8230;note that you will be prompted for the admin user credentials, and by specifying the &#8220;[Root]&#8221; object, it will grab every single object in the tree and put it in the specified file.<\/p>\n<p>Now, let&#8217;s get a little fancier:<\/p>\n<pre><code>ndsbackup cvf \/tmp\/ndsbackup.`date +%Y%m%d%H%M`.bak -a admin.corp [Root]<\/code><\/pre>\n<p>&#8230;here we are adding a date stamp to the output file, and giving it the admin username.\u00a0  It will still prompt for the admin password, of course.\u00a0  There are tricks to handle that, too, but this is good enough to get the point across.<\/p>\n<p>If you want to see what&#8217;s in your backup file:<\/p>\n<pre><code>ndsbackup tf \/tmp\/ndsbackup.201003051421.bak<\/code><\/pre>\n<p>Make sure to copy that backup file off the server somewhere, somehow.\u00a0 In reality, you might actually be writing the result directly to an <code>nfs<\/code> or <code>samba<\/code> share or something anyway, but the point is to get the data off the box for safety.<\/p>\n<p>So let&#8217;s imagine a week goes by, and whoops&#8230; you deleted someone accidentally.\u00a0 Don&#8217;t worry!\u00a0 Because all you have to do to restore that user object is to put the file back on the filesystem where you can reach it, and do something like this&#8230;<\/p>\n<p>To restore just that user you deleted:<\/p>\n<pre><code>ndsbackup wxvf \/tmp\/ndsbackup.201003051421.bak -a admin.corp cn=duser.ou=Users.o=corp<\/code><\/pre>\n<p>Or, plow in the whole container if you accidentally wiped it all out:<\/p>\n<pre><code>ndsbackup wxvf \/tmp\/ndsbackup.201003051421.bak -a admin.corp ou=Users.o=corp<\/code><\/pre>\n<p>&#8230;If you wish, you can remove the &#8220;<code>w<\/code>&#8221; from the above restore examples if you don&#8217;t want to be prompted to confirm for each object.\u00a0 However, I tend to think the &#8220;<code>w<\/code>&#8221; is a good idea&#8230;<\/p>\n<p>That&#8217;s all for now.\u00a0 Of course, there are tons more options for <code>ndsbackup<\/code> if you look in the man page, but I&#8217;m not going in to that, because after all, this *is* a cheat sheet&#8230;<\/p>\n<p>\ud83d\ude42<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here&#8217;s a quick cheat-sheet on how to do fast backup of your eDirectory tree from an OES Linux server.\u00a0 While we&#8217;re at it, we&#8217;ll do a quick restore of an object. First, let&#8217;s back it up!\u00a0 Let&#8217;s grab the whole&#8230;<br \/><a class=\"read-more-button\" href=\"https:\/\/yourLinuxGuy.com\/?p=518\">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,90,13],"tags":[],"class_list":["post-518","post","type-post","status-publish","format-standard","hentry","category-intermediate","category-ndsbackup","category-oeslinux"],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/pnjn1-8m","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/yourLinuxGuy.com\/index.php?rest_route=\/wp\/v2\/posts\/518","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=518"}],"version-history":[{"count":4,"href":"https:\/\/yourLinuxGuy.com\/index.php?rest_route=\/wp\/v2\/posts\/518\/revisions"}],"predecessor-version":[{"id":521,"href":"https:\/\/yourLinuxGuy.com\/index.php?rest_route=\/wp\/v2\/posts\/518\/revisions\/521"}],"wp:attachment":[{"href":"https:\/\/yourLinuxGuy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=518"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/yourLinuxGuy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=518"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/yourLinuxGuy.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=518"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}