Video Screencast Help
Symantec Appoints Michael A. Brown CEO. Learn more.

netbackup 100 client offline

Created: 20 Jun 2013 • Updated: 25 Jun 2013 | 13 comments
This issue has been solved. See solution.

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
 
=====================================
 
Operating Systems:

Comments 13 CommentsJump to latest comment

mph999's picture

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
 
NIKHIL2346565959's picture
 #!/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's picture

/tmp/clientlist

 

Regards,  Martin
 
Setting Logs in NetBackup:
http://www.symantec.com/docs/TECH75805
 
NIKHIL2346565959's picture

  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's picture

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
 
huanglao2002's picture

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

I think the logical is correct.

NIKHIL2346565959's picture

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's picture

script above WIILL do this!

NIKHIL2346565959's picture

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?

NIKHIL2346565959's picture

Hi All,

 

Please update,This is urgent.prod isssue

mph999's picture

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
 
SOLUTION
Vickie's picture
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