{"id":2444,"date":"2010-08-05T05:03:14","date_gmt":"2010-08-04T19:03:14","guid":{"rendered":"http:\/\/nsrd.info\/blog\/?p=2444"},"modified":"2018-12-11T18:34:27","modified_gmt":"2018-12-11T08:34:27","slug":"basics-specifying-a-default-jukebox","status":"publish","type":"post","link":"https:\/\/nsrd.info\/blog\/2010\/08\/05\/basics-specifying-a-default-jukebox\/","title":{"rendered":"Basics &#8211; Specifying a default Jukebox"},"content":{"rendered":"<p>If you&#8217;ve got multiple jukeboxes within a NetWorker environment, but primarily work with one of them, you may find &#8216;nsrjb&#8217; to be a bit of a pain any time you forget to specify the jukebox name. If you&#8217;re not familiar with this, here&#8217;s how nsrjb reacts in this situation:<\/p>\n<pre>[root@tara ~]# nsrjb\n1:\tVTL1 \t[enabled]\n2:\tVTL2 \t[enabled]\nNo jukebox selected.\nPlease select a jukebox to use:? [1] _<\/pre>\n<p>(Slight aside: never assume the numbered list is the same; NetWorker doesn&#8217;t guarantee the order being the same between executions &#8211; in fact, I actually only put in an RFE about this a couple of days ago, as I&#8217;m hoping it could at least be alphabetically ordered at all times&#8230;)<\/p>\n<p>If you want to avoid the jukebox-prompt from nsrjb, one of the easiest ways is to specify the jukebox name as part of the command &#8211; e.g.,<\/p>\n<pre>[root@tara ~]# nsrjb -j VTL1<\/pre>\n<p>That&#8217;s fine of course, but if the vast majority of the time you perform operations on a single jukebox, you can specify a default jukebox as an environment variable (NSR_JUKEBOX) and streamline your processes. For example, on Linux, using the bash, this might look as follows:<\/p>\n<pre>[root@tara ~]# export NSR_JUKEBOX=VTL1\n[root@tara ~]# nsrjb<\/pre>\n<pre>Jukebox VTL1: (Ready to accept commands)\nslot &nbsp;volume &nbsp; &nbsp; &nbsp; &nbsp; pool &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; barcode &nbsp; volume id &nbsp; &nbsp; &nbsp; &nbsp;recyclable\n1: 800840L4 &nbsp; &nbsp; &nbsp; ClientTesting &nbsp;800840L4 &nbsp;3814088325 &nbsp; &nbsp; &nbsp; no\n2: 800841L4 &nbsp; &nbsp; &nbsp; ClientTesting &nbsp;800841L4 &nbsp;3797311146 &nbsp; &nbsp; &nbsp; no\n3: 800842L4 &nbsp; &nbsp; &nbsp; ClientTesting &nbsp;800842L4 &nbsp;3847642669 &nbsp; &nbsp; &nbsp; no\n4: 800843L4 &nbsp; &nbsp; &nbsp; ClientTesting &nbsp;800843L4 &nbsp;3780533937 &nbsp; &nbsp; &nbsp; no\n5: 800844L4 &nbsp; &nbsp; &nbsp; ClientTesting &nbsp;800844L4 &nbsp;3763756765 &nbsp; &nbsp; &nbsp; yes\n6: 800845L4 &nbsp; &nbsp; &nbsp; ClientTesting &nbsp;800845L4 &nbsp;3864419885 &nbsp; &nbsp; &nbsp; yes\n&lt;snip&gt;<\/pre>\n<p>Being an environment variable, this is something you can choose to set locally \u2013 say, on a per storage-node basis, when you have multiple storage nodes. It&#8217;s relatively common for instance to have a tape library on one or more storage nodes, so for the appropriate logins (or even at a system level) on each storage node it would be possible to set the local jukebox as the default, thereby streamlining usage of the units.<\/p>\n<p>As an example, here&#8217;s a lab storage node with the setting in use:<\/p>\n<pre>[root@fawn ~]# export NSR_JUKEBOX=\"rd=fawn:VTL3\"\n[root@fawn ~]# nsrjb -s tara<\/pre>\n<pre>Jukebox rd=fawn:VTL3: (Ready to accept commands)\n&lt;snip&gt;<\/pre>\n<p>For something that can take you less than 30 seconds to set, the environment variable NSR_JUKEBOX can certainly be a big time saver if you have multiple jukeboxes in your environment and (like me) you&#8217;re a command line junkie.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you&#8217;ve got multiple jukeboxes within a NetWorker environment, but primarily work with one of them, you may find &#8216;nsrjb&#8217;&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":[6,16,20],"tags":[1243,303,512,680],"class_list":["post-2444","post","type-post","status-publish","format-standard","hentry","category-basics","category-networker","category-scripting","tag-basics","tag-default-jukebox","tag-jukebox","tag-nsr_jukebox"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/pKpIN-Dq","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/nsrd.info\/blog\/wp-json\/wp\/v2\/posts\/2444","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=2444"}],"version-history":[{"count":1,"href":"https:\/\/nsrd.info\/blog\/wp-json\/wp\/v2\/posts\/2444\/revisions"}],"predecessor-version":[{"id":7546,"href":"https:\/\/nsrd.info\/blog\/wp-json\/wp\/v2\/posts\/2444\/revisions\/7546"}],"wp:attachment":[{"href":"https:\/\/nsrd.info\/blog\/wp-json\/wp\/v2\/media?parent=2444"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nsrd.info\/blog\/wp-json\/wp\/v2\/categories?post=2444"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nsrd.info\/blog\/wp-json\/wp\/v2\/tags?post=2444"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}