cancel
Showing results for 
Search instead for 
Did you mean: 

sudo ./bpstart_notify.lx245-PNBV

NIKHIL234656595
Level 6

 

bash-3.00$ sudo ./bpstart_notify.lx245-PNBV
Password:
bash-3.00$ pwd
/usr/openv/netbackup/bin
bash-3.00$
 
lx245-PNBV  :This is the policy name
I run the above script and getting no error when i run the command.What does this eans?
1 ACCEPTED SOLUTION

Accepted Solutions

mph999
Level 6
Employee Accredited

Example.

In a bpend_notify script I modified ...

I set file descriptor 3 to be the 'log file'

 

OUTF=/netbackup/sym/bpend.$$.$(date '+%m%d%y%n')  #Set logfile
exec 3>$OUTF #Define file descriptor 3 for logfile
 
Then, when ever I did something in the script that would contain output, it was rediected to the logfile'
 
echo "Policy $2" >&3
 
A more simple version, is just to redirect the output to a file
 
echo "something" >/tmp/somefile
 
Really, you should do something like this :
 
echo "Policy $2" >/tmp/somefile 2>&1 
 
This means any output, even if there is an error would go to the /tmp/somefile, ensuring nothing is sent to the screen.
 
Martin
 
 

View solution in original post

7 REPLIES 7

NIKHIL234656595
Level 6

 

bash-3.00$ sudo ./bpstart_notify.lx245-PNBV
Password:
bash-3.00$ pwd
/usr/openv/netbackup/bin
bash-3.00$
 
lx245-PNBV  :This is the policy name
I run the above script and getting no error when i run the command.What does this means?

Nicolai
Moderator
Moderator
Partner    VIP   

check the sudoers file, you shouldn't get prompted for a password when using sudo.

if bpstart_notify.lx245-PNBV is unaltered it probaly does nothing. But I can say - you need to take a look at the script.

NIKHIL234656595
Level 6

What does this does?sudo ./bpstart_notify.lx245-PNBV

 

If i got the error then?

Marianne
Level 6
Partner    VIP    Accredited Certified

My goodness Nikhil! Why did you expect an error? 

Look at the contents of the script with :
more bpstart_notify.lx245-PNBV

Look at the commands that are listed in the script. Default bpstart_notify script contains no commands - they are there for the user to add commands to run before backup starts.

If i got the error then?

This will mean that something is wrong with the script. Check the script.

mph999
Level 6
Employee Accredited

I would say no error is good.

The bpstart scripts are not meant to put output to the screen, this can cause problems, so when running one of these I would expect to see absolutely nothing, with any output being suppressed (cancelled) for exampe with /dev/null

Martin

Marianne
Level 6
Partner    VIP    Accredited Certified

If you have copied the sample bpstart_notify script in goodies directory on the master server, you fill find a lot of information in the top of the file (All lines starting with #).

You will find this line as well:

# CAUTION:  writing anything to stdout or stderr will cause backup problems

This means that output will not be displayed on the screen.

The sample script create an output file:

OUTF=/usr/openv/netbackup/bin/BPSTART_CALLED

So, to see output of your script, first of all see if there is a similar line in your script.
Check if all commands in the script sends its output to the 'OUT-file' :  >> $OUTF

In the above example, there will be a fille called BPSTART_CALLED in /usr/openv/netbackup/bin/ directory.
This file will contain output of script.

mph999
Level 6
Employee Accredited

Example.

In a bpend_notify script I modified ...

I set file descriptor 3 to be the 'log file'

 

OUTF=/netbackup/sym/bpend.$$.$(date '+%m%d%y%n')  #Set logfile
exec 3>$OUTF #Define file descriptor 3 for logfile
 
Then, when ever I did something in the script that would contain output, it was rediected to the logfile'
 
echo "Policy $2" >&3
 
A more simple version, is just to redirect the output to a file
 
echo "something" >/tmp/somefile
 
Really, you should do something like this :
 
echo "Policy $2" >/tmp/somefile 2>&1 
 
This means any output, even if there is an error would go to the /tmp/somefile, ensuring nothing is sent to the screen.
 
Martin