This issue has been solved.

netbackup 100 client offline

Created: 20 Jun 2013 • Updated: 25 Jun 2013
Login to vote
-1 1 Vote

Hi ALL,

I have an activity on my master server.

 

I need to make 100 client offline so that Backup SLA is not affected.

Can anybody provide me with complete scripts for this.

NBU 7.1

LINUX

I cant suspend my scheduler.

============================
 
for client in `cat listofclients`
 
do
 
bpclient -client $client -update -offline -ut -onlineat unixtime.
 
done
 
=====================================
 

Filed Under

Comments

mph999
Symantec Employee
Accredited
20
Jun
2013

I am not sure what you are

I am not sure what you are after you already appear to have the script

You do have to add each client to the client DB

Eg.

 bpclient -client nbmaster00 -add

Then I can run a command like this :

bpclient -client nbmaster00 -update -offline -ut -onlineat 1372730570

And confirm it is offline

root@nbmaster00 testdata $ bpclient -client nbmaster00 -L
Client Name: nbmaster00
 Current Host:
        Hostname: nbmaster00
 Offline:       Yes
 Online at:     07/01/2013 19:02:50
 
 
So if clientlist is the file containing the list of clients
 
cat clientlist |while read line 
do
 bpclient -client $line -add
done
 
cat clientlist |while read line 
do
bpclient -client $line -update -offline -ut -onlineat 1372730570
done
 

You will have to work out the ctime to use to get the cllients back online

eg.  http://www.epochconverter.com/

Martin

 

Regards,  Martin
 
Setting Logs in NetBackup:
http://www.symantec.com/docs/TECH75805
 
20
Jun
2013

 #!/bin/ksh   PATH=$PATH:/usr

 #!/bin/ksh
 
PATH=$PATH:/usr/openv/netbackup/bin:/usr/openv/netbackup/bin/admincmd
 
for client in `cat listofclients`
 
do
 
bpclient -client $client -update -offline -ut -onlineat unixtime.
 
done
 
=================
 #!/bin/ksh
 
PATH=$PATH:/usr/openv/netbackup/bin:/usr/openv/netbackup/bin/admincmd
 
cat clientlist |while read line 
do
bpclient -client $line -update -offline -ut -onlineat 1372730570
done

===============

 

Please tell me the steps:

1.I have to create a file clientlist.I will be creating it in /tmp. So what is the path I have to give?

 

mph999
Symantec Employee
Accredited
20
Jun
2013

/tmp/clientlist

/tmp/clientlist

 

Regards,  Martin
 
Setting Logs in NetBackup:
http://www.symantec.com/docs/TECH75805
 
20
Jun
2013

  cat

  cat offline.sh
 #!/bin/ksh
PATH=$PATH:/usr/openv/netbackup/bin:/usr/openv/netbackup/bin/admincmd
cat /tmp/offclient |while read line
do
bpclient -client $line -update -offline -ut -onlineat 1371859200
done
 

[admincmd]$ cat /tmp/offclient
unix12

[admincmd]$ pwd
/usr/openv/netbackup/bin/admincmd
 

 []$ ls -ltr /tmp/offclient
-rwxrwxrwx 1 root root 33 Jun 20 16:41 /tmp/offclient

 

Getting the below error when running the script:(client is added in host prop--client attributes)

 

[ admincmd]$ sudo ./offline.sh
bpclient: cannot determine query type

 

[]$ pwd
/usr/openv/netbackup/bin/admincmd
[ admincmd]$

 

mph999
Symantec Employee
Accredited
20
Jun
2013

Not sure at the moment, the

Not sure at the moment, the command I posted I tested on my system so I am confident it is correct.

Did you add the client(s)

bpclient -client -add

What does this show

bpclient -client -L

Try running the command itself

bpclient -client -update -offline -ut -onlineat 1371859200

I'll have a look tomorrow (Fri) on a test system.

Martin

 

Regards,  Martin
 
Setting Logs in NetBackup:
http://www.symantec.com/docs/TECH75805
 
20
Jun
2013

Can you try to use full path

Can you try to use full path /usr/openv/netbackup/bin/admincmd/bpclient instead the bpclient?

I think the logical is correct.

21
Jun
2013

Yes ,I add the

Yes ,I add the client.

 

Client is going offline with above command.

I need to do that in one shot for more than 100 client.

Please let me confirm

revaroo
Symantec Employee
21
Jun
2013

script above WIILL do this!

script above WIILL do this!

21
Jun
2013

Command ran successfully. Now

Command ran successfully.

Now what to do to make them all online now?

i.e what all changes I have to made to this script for making all the client online now?

21
Jun
2013

Hi All,   Please update,This

Hi All,

 

Please update,This is urgent.prod isssue

mph999
Symantec Employee
Accredited
21
Jun
2013

Change this bpclient -client

Change this

bpclient -client -update -offline -ut -onlineat 1371859200

to this

bpclient -client -update -online

 

 

 

 

Regards,  Martin
 
Setting Logs in NetBackup:
http://www.symantec.com/docs/TECH75805
 
25
Jun
2013

Nikhil,   Just made changes

Nikhil,
 
Just made changes to script as below
 
#!/bin/ksh
PATH=$PATH:/usr/openv/netbackup/bin:/usr/openv/netbackup/bin/admincmd
cat /tmp/offclient |while read line
do
/usr/openv/netbackup/bin/admincmd/bpclient -client $line -update -online
done
25
Jun
2013

Thanks ALL.

Thanks ALL.