Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating resources via script 1

Status
Not open for further replies.

MoshiachNow

IS-IT--Management
Feb 6, 2002
1,851
IL
I'd like to create a script that does the basic Legato config after the installation,saving lot's of engineers time.

Could you please send me couple of a sample scripts where one changes/adds/deletes resourses (clients,groups,etc)?
 
I've got a few scripts, but all are doing only small tasks. Together with awk, sed, perl, grep and sort you could do all kind of magic.
My main problem was that nsradmin with a << always gave me two prompts before generating any output, throwing all scripts out of order. nsradmin -i - << solved the problem.

Have a look at one example disabling all drives:
Code:
nsradmin -s sundasi -i - <<EOF | grep name | nawk '{
print &quot;. name: &quot; $2 &quot; type: NSR device&quot;
print &quot;update enabled: No&quot;
print &quot;yes&quot;} ' | nsradmin -s sundasi | grep failed
. type: NSR device
show name
print
EOF
[\code]
The output created by awk gets all devices, selects one by one, disables the drive and confirms the change. Same as you would expect doing it interactively.

If you want to use ready made scripts have a look at: [URL unfurl="true"]http://www.backupcentral.com[/URL] they have quite a lot of scripts and also info on the networker.

Johanes
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top