UNSOLVED

dieselboi1

updated

20 years ago

0

1385

June 9th, 2006 15:00

Using NSRAdmin to disable autorestart

I want to use NSRAdmin and NSR_Group to set the autorestart to disabled.

I'm in Windows and would prefer to script this - i.e. run against a list lf 40 groups, setting all of them to disabled.

I see that nsradmin runs interactively, but there is also the ability to create a file to run it against. How does one do that?

Also, I will need to have a script to create a list of our groups and pipe it to a text file. I'm still researching that.

Thank you.
  • ble1

    6 Operator

    14354 Posts

    56186 Points

    633

    0

    Posted June 11th, 2006 04:00

    Here is small hint:

    C:\Documents and Settings\Hrvoje Crvelin>type 1.txt
    show name
    show autostart
    print type:NSR group;
    quit
     
    C:\Documents and Settings\Hrvoje Crvelin>type 2.txt
    show name
    show autostart
    print type:NSR group; name: Default
    update autostart: Enabled
    show name
    show autostart
    print type:NSR group; name: Default
    quit
     
    C:\Documents and Settings\Hrvoje Crvelin>nsradmin -i 1.txt
                            name: Default;
                       autostart: Disabled;
     
    C:\Documents and Settings\Hrvoje Crvelin>nsradmin -i 2.txt
                            name: Default;
                       autostart: Disabled;
    updated resource id 66.0.108.10.179.187.126.68.192.168.1.11(13)
                            name: Default;
                       autostart: Enabled;
    
  • cluu1

    23 Posts

    633

    0

    Posted June 12th, 2006 13:00

    Here you go...put the following syntax in a .bat file and run it. Make sure this is on the NetWorker server as it will fail if it's on a different system.

    @Echo Off
    Echo show name;autostart >t1.tnf
    Echo print type:NSR group >>t1.tnf
    Echo update autostart: Disabled;
    nsradmin -i t1.tnf |find "name" >>grpname.tnf
    Echo Current Groups in NetWorker >grpnames.txt
    Echo ------------------------------------------ >>grpnames.txt
    For /F "tokens=2 delims=; " %%a in (grpname2.tnf) do Echo %%a >>grpnames.txt
    Del t1.tnf
    Del grpname.tnf
    Cls
    Echo Please view the text file "grpnames.txt" for the list of group names.
  • 633

    0

    Posted June 12th, 2006 15:00

    Charles, could you assist me in understanding parts of this script?

    At the beginning, it states "show name;autostart" should the ; be a : ?

    Further, should the 3rd line - Echo update autostart: disabled also be >t1.tnf?

    This looks like a unix script. If so, could someone assist me in making it for windows?

    thanks.
  • ble1

    6 Operator

    14354 Posts

    56186 Points

    633

    0

    Posted June 13th, 2006 00:00

    You could install MS Windows services for UNIX or Cygwin package to support UNIX commands. The major trouble I found with native Windows is lack of support for scripting as on native UNIX systems.
  • cluu1

    23 Posts

    633

    0

    Posted June 13th, 2006 13:00

    Hi Brett;

    This script is for Windows. To answer your questions:

    At the beginning, it states "show name;autostart" should the ; be a : ?
    No the semi colon ; is a separation of fields to show. The colon : is used to identify a value for the field.

    Further, should the 3rd line - Echo update autostart: disabled also be >t1.tnf?
    Yes, sorta. It should be >>t1.tnf as you want to append to what's already there. The single > is use to output to a file overwriting what's currently in it. The double >> is used to append to the file. The "Echo update autostart: Disabled;" line needs to have a capital D in it and not a lower case.