{"id":2123,"date":"2010-04-06T06:37:05","date_gmt":"2010-04-05T20:37:05","guid":{"rendered":"http:\/\/nsrd.info\/blog\/?p=2123"},"modified":"2018-12-11T18:48:32","modified_gmt":"2018-12-11T08:48:32","slug":"basics-previewing-directives","status":"publish","type":"post","link":"https:\/\/nsrd.info\/blog\/2010\/04\/06\/basics-previewing-directives\/","title":{"rendered":"Basics &#8211; Previewing Directives"},"content":{"rendered":"<p>There&#8217;s been some discussion in the EMC Community Forum lately as to whether it would be handy to have a directive preview option in NMC. I&#8217;d suggest it is, but if you need this now then you don&#8217;t have anything to wait for, so long as you&#8217;re willing to work on the command line.<\/p>\n<p>The way you do this is via the <em>save<\/em> command, invoking with the switches &#8220;-n&#8221; and &#8220;-v&#8221;. Of course, these can be used in the same argument (-nv or if you prefer, -vn). The &#8220;-n&#8221; option tells NetWorker not to actually perform the backup, while the &#8220;-v&#8221; option tells NetWorker to be verbose as it walks the filesystem. This verbosity will tell you what application specific module (ASM) NetWorker is going to invoke against each file\/directory encountered.<\/p>\n<p>For instance, let&#8217;s consider a save against the \/root folder on a backup server where I&#8217;ve got a directive that&#8217;s configured to skip everything in there. The start of the output looks like the following:<\/p>\n<pre>[root@tara ~]# save -b Default -nv \/root\n3817:save: Using tara.pmdg.lab as server\n70342:save: save: got prototype for \/\n70342:save: save: got prototype for \/\n70342:save: save: got prototype for \/dev\/\n70342:save: save: got prototype for \/\n70342:save: save: got prototype for \/dev\/\n70342:save: save: got prototype for \/\n70342:save: save: got prototype for \/opt\/\n70342:save: save: got prototype for \/\n70342:save: save: got prototype for \/\n70342:save: save: got prototype for \/\n70342:save: save: got prototype for \/\n70342:save: save: got prototype for \/\n70342:save: save: got prototype for \/media\/\n70342:save: save: got prototype for \/proc\/sys\/fs\/\n70342:save: save: got prototype for \/var\/lib\/nfs\/\nchdir(\/root)\nName=`\/root\/', name=`\/root\/', fname=`.\/'\n32240:save: found protofile spec for \/:\nmntasm : backup4\n70342:save: save: got prototype for \/\n66135:save: NSR directive file (\/.nsr) parsed\n70342:save: save: got prototype for \/root\/\n66135:save: NSR directive file (\/root\/.nsr) parsed\nwalk(\/root\/, .\/)\nwalk(\/root\/.nsr, .nsr)\nuasm -s \/root\/.nsr\nwalk(\/root\/.odbc.ini, .odbc.ini)\nuasm -s \/root\/.odbc.ini\nwalk(\/root\/backup.log, backup.log)\n32246:save: matched internal `skip' on `backup.log' for `\/root\/backup.log'\nwalk(\/root\/micromanual-nsradmin, micromanual-nsradmin)\n32246:save: matched internal `skip' on `micromanual-nsradmin' for `\/root\/micromanual-nsradmin'\nwalk(\/root\/lose-files.sh, lose-files.sh)\n32246:save: matched internal `skip' on `licenses.sh' for `\/root\/lose-files.sh'<\/pre>\n<p>As you can see by the above, we get a file-by-file analysis of the walk process, and that includes the ASM that will be invoked against that file. For instance, looking at the &#8216;backup.log&#8217; file, we see:<\/p>\n<blockquote>\n<div id=\"_mcePaste\"><em>walk(\/root\/backup.log, backup.log)<\/em><\/div>\n<div id=\"_mcePaste\"><em>32246:save: matched internal `skip&#8217; on `backup.log&#8217; for `\/root\/backup.log&#8217;<\/em><\/div>\n<\/blockquote>\n<p>So the first line tells us that it&#8217;s encountered a file called &#8216;backup.log&#8217;, with a full path of &#8216;\/root\/backup.log&#8217;. The second line tells us that it&#8217;s matched the (internal) ASM, &#8216;skip&#8217;, on the file &#8216;backup.log&#8217; for the path &#8216;\/root\/backup.log&#8217; &#8211; i.e., it&#8217;s effectively telling us that it will skip that file.<\/p>\n<p>While it may be messy, it is a valid and usable technique to see what your directives are going to do.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>There&#8217;s been some discussion in the EMC Community Forum lately as to whether it would be handy to have a&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":[324,852],"class_list":["post-2123","post","type-post","status-publish","format-standard","hentry","category-networker","category-scripting","tag-directive","tag-save"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/pKpIN-yf","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/nsrd.info\/blog\/wp-json\/wp\/v2\/posts\/2123","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=2123"}],"version-history":[{"count":1,"href":"https:\/\/nsrd.info\/blog\/wp-json\/wp\/v2\/posts\/2123\/revisions"}],"predecessor-version":[{"id":7563,"href":"https:\/\/nsrd.info\/blog\/wp-json\/wp\/v2\/posts\/2123\/revisions\/7563"}],"wp:attachment":[{"href":"https:\/\/nsrd.info\/blog\/wp-json\/wp\/v2\/media?parent=2123"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nsrd.info\/blog\/wp-json\/wp\/v2\/categories?post=2123"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nsrd.info\/blog\/wp-json\/wp\/v2\/tags?post=2123"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}