{"id":35,"date":"2009-01-27T08:30:36","date_gmt":"2009-01-27T08:30:36","guid":{"rendered":"http:\/\/nsrd.wordpress.com\/?p=35"},"modified":"2018-12-12T16:37:34","modified_gmt":"2018-12-12T06:37:34","slug":"basics-listing-files-in-a-backup","status":"publish","type":"post","link":"https:\/\/nsrd.info\/blog\/2009\/01\/27\/basics-listing-files-in-a-backup\/","title":{"rendered":"Basics &#8211; Listing files in a backup"},"content":{"rendered":"<p>A fairly common question I get asked is &#8220;How can I find out what files were backed up?&#8221;<\/p>\n<p>This is actually fairly easy, particularly if you&#8217;re prepared to use the command line. You need to run two commands &#8211; mminfo, and nsrinfo.<\/p>\n<p>The command mminfo accesses the NetWorker media database, and is used to pull out details of the saveset whose files you want to view. The nsrinfo command is then used to retrieve the relevant information from the client file index.<\/p>\n<p>For example, consider the following situation &#8211; there&#8217;s two incremental backups of the &#8220;\/etc&#8221; directory on the machine &#8220;faero&#8221;, and we want to know what was backed up in each backup. First, run mminfo to retrieve the <em>nsavetime<\/em>, which we use in nsrinfo. The mminfo command might resemble the following:<\/p>\n<pre># mminfo -q \"name=\/etc,volume=Default.001.RO,level=incr\"\n-r \"savetime(22),nsavetime\"\n&nbsp;&nbsp;&nbsp;&nbsp; date&nbsp;&nbsp;&nbsp;&nbsp; time&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; save time\n&nbsp;&nbsp;&nbsp;&nbsp; 01\/27\/09 09:57:52 1233010672\n&nbsp;&nbsp;&nbsp;&nbsp; 01\/27\/09 16:39:04 1233034744<\/pre>\n<p>Having retrieved the <em>nsavetime<\/em> field, we can then feed that into nsrinfo in order to get the list of files for that backup:<\/p>\n<pre># nsrinfo -t 1233034744 faero\nscanning client `faero' for savetime 1233034744(Tue Jan 27 16:39:04 2009)\nfrom the backup namespace\n\/etc\/svc\/volatile\/\/\n\/etc\/svc\/\n\/etc\/mnttab\/\/\n\/etc\/\n\/\n5 objects found<\/pre>\n<p>(So the most common invocation format of nsrinfo is: &#8220;nsrinfo -t nsavetime clientName&#8221;)<\/p>\n<p>Like most NetWorker commands, nsrinfo will also accept a &#8220;-v&#8221; option for verbosity. Include this in your nsrinfo command and you get a whole lot more information. For example, a short excerpt from the same nsavetime\/saveset used above would resemble the following:<\/p>\n<pre># nsrinfo -v -t 1233034744 faero\nscanning client `faero' for savetime 1233034744(Tue Jan 27 16:39:04 2009)\nfrom the backup namespace\nUNIX ASDF v2 file `\/etc\/svc\/volatile\/\/', NSR size=160, fid = 0.0, file size=512\nUNIX ASDF v2 file `\/etc\/svc\/', NSR size=632, fid = 4294967295.1520, file size=1024\n&nbsp; ndirentry-&gt;1433&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ..\n&nbsp; ndirentry-&gt;0&nbsp; volatile\/\/\n&nbsp; ndirentry-&gt;1945&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; repository.db\n&nbsp; ndirentry-&gt;978&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; repository-boot\n&nbsp; ndirentry-&gt;1002&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; repository-manifest_import\n&nbsp; ndirentry-&gt;4310&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; repository-manifest_import-20070225_055641\n&nbsp; ndirentry-&gt;714&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; repository-boot-20070907_074755\n&nbsp; ndirentry-&gt;1001&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; repository-manifest_import-20070907_074828\n&nbsp; ndirentry-&gt;44611&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; repository-manifest_import-20070225_093651\n&nbsp; ndirentry-&gt;988&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; repository-boot-20071004_111149\n&nbsp; ndirentry-&gt;1014&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; repository-boot-20080414_023012\n&nbsp; ndirentry-&gt;1066&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; repository-boot-20070920_041017\nUNIX ASDF v2 file `\/etc\/mnttab\/\/', NSR size=156, fid = 0.0, file size=512\nUNIX ASDF v2 file `\/etc\/', NSR size=5040, fid = 4294967295.1433, file size=4608\n&nbsp; ndirentry-&gt;2&nbsp; ..\n&nbsp; ndirentry-&gt;1434&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TIMEZONE<\/pre>\n<p>As you can see, this is a lot more information. It&#8217;s not necessarily information you need all the time, but like so many other chunks of information retievable from NetWorker, it&#8217;s useful to know <em>how<\/em> to retrieve it, <em>and<\/em> that it&#8217;s available should you need it.<\/p>\n<p>If you&#8217;re wondering <em>how<\/em> NetWorker knows which saveset to retrieve based on the <em>nsavetime<\/em>, it&#8217;s simple &#8211; for any individual client, no two savesets will <em>ever<\/em> be generated with the same <em>nsavetime<\/em>. Check it out for yourself if you&#8217;re not sure. For example, from a backup with parallelism of 12 for one client (i.e,. higher parallelism than savesets), the savesets were generated as follows:<\/p>\n<pre># mminfo -q \"client=faero\" -r \"name,level,savetime(22),nsavetime\" -ot\n&nbsp;name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lvl&nbsp;&nbsp;&nbsp;&nbsp; date&nbsp;&nbsp;&nbsp;&nbsp; time&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; save time\n\/opt\/ActivePerl-5.8&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; full&nbsp;&nbsp;&nbsp;&nbsp; 01\/27\/09 09:49:01 1233010141\n\/opt\/IDATA&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; full&nbsp;&nbsp;&nbsp;&nbsp; 01\/27\/09 09:49:02 1233010142\n\/space\/debug\/2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; full&nbsp;&nbsp;&nbsp;&nbsp; 01\/27\/09 09:49:03 1233010143\n\/space\/debug\/1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; full&nbsp;&nbsp;&nbsp;&nbsp; 01\/27\/09 09:49:04 1233010144\n\/opt\/SUNWrtvc&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; full&nbsp;&nbsp;&nbsp;&nbsp; 01\/27\/09 09:49:05 1233010145\n\/opt\/SUNWmlib&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; full&nbsp;&nbsp;&nbsp;&nbsp; 01\/27\/09 09:49:06 1233010146\n\/etc&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; full&nbsp;&nbsp;&nbsp;&nbsp; 01\/27\/09 09:50:15 1233010215\nindex:faero&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; full&nbsp;&nbsp;&nbsp;&nbsp; 01\/27\/09 09:55:29 1233010529\nbootstrap&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; full&nbsp;&nbsp;&nbsp;&nbsp; 01\/27\/09 09:55:30 1233010530<\/pre>\n<p>So you can see &#8211; even with parallelism greater than one, there&#8217;s always <em>at least<\/em> one second difference between the start time for savesets.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A fairly common question I get asked is &#8220;How can I find out what files were backed up?&#8221; This is&hellip;<\/p>\n","protected":false},"author":1,"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":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[16,20],"tags":[464,1249,1253,871],"class_list":["post-35","post","type-post","status-publish","format-standard","hentry","category-networker","category-scripting","tag-index","tag-networker","tag-scripting","tag-scripts"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/pKpIN-z","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/nsrd.info\/blog\/wp-json\/wp\/v2\/posts\/35","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nsrd.info\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nsrd.info\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nsrd.info\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nsrd.info\/blog\/wp-json\/wp\/v2\/comments?post=35"}],"version-history":[{"count":1,"href":"https:\/\/nsrd.info\/blog\/wp-json\/wp\/v2\/posts\/35\/revisions"}],"predecessor-version":[{"id":7699,"href":"https:\/\/nsrd.info\/blog\/wp-json\/wp\/v2\/posts\/35\/revisions\/7699"}],"wp:attachment":[{"href":"https:\/\/nsrd.info\/blog\/wp-json\/wp\/v2\/media?parent=35"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nsrd.info\/blog\/wp-json\/wp\/v2\/categories?post=35"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nsrd.info\/blog\/wp-json\/wp\/v2\/tags?post=35"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}