cancel
Showing results for 
Search instead for 
Did you mean: 

bpstart_notify cannot run /etc/init.d/ntpd stop

ryokijima
Level 3
Partner Accredited
I have linux NBU clients. I want to stop ntpd before starting backup on the linux client. I wrote bpstart_notify ---------- echo aaa >> /tmp/aaa /etc/init.d/ntpd stop ---------- The bpstart_notify can run echo, but cannot run /etc/init.d/ntpd stop. Why? Please tell me how to work.
1 ACCEPTED SOLUTION

Accepted Solutions

Nicolai
Moderator
Moderator
Partner    VIP   

To find out why it fails you need to see the error text from the bpstart_notify

This is a example of how you can modify the script to log error messages to a text file:

 

#!/bin/ksh

set -x

# Close STDOUT file descriptor

exec 1<&-

# Close STDERR FD

exec 2<&-

# Open STDOUT as $LOG_FILE file for read and write.

exec 1<> /tmp/nma.txt

# Redirect STDERR to STDOUT

exec 2>&1

echo "This line will appear in $LOG_FILE, not 'on screen'"

# Should end up in timer_log.log

echo "This is a message"

echxo "This is an error message!"

View solution in original post

6 REPLIES 6

Nicolai
Moderator
Moderator
Partner    VIP   

Why would you stop the Network Time Protocol daemons ?

NTP ensure the computer clock is correct and do not drift

Will_Restore
Level 6

I can't think why you'd want to do that either.  But to test the script, first make sure the command is valid by running it by hand.

  /etc/init.d/ntpd stop

Then verify the script is in the correct folder and run it manually

  /usr/openv/netbackup/bin/bpstart_notify

 

Mark_Solutions
Level 6
Partner Accredited Certified

If the command runs correctly manually then you need to find out why it cannot run when the backup does .. that could be a rights issue so check the permissions for root on the files (ntpd and the bpstart_notify)

ryokijima
Level 3
Partner Accredited

Sorry. NTP is an examle.

I would like to stop some serives.

SymTerry
Level 6
Employee Accredited

Same thing, permissions to do so. run it manually first, if it works but doesn't with the script, then it permissions or something else. What version of NetBackup and are you running it from an appliance?

Nicolai
Moderator
Moderator
Partner    VIP   

To find out why it fails you need to see the error text from the bpstart_notify

This is a example of how you can modify the script to log error messages to a text file:

 

#!/bin/ksh

set -x

# Close STDOUT file descriptor

exec 1<&-

# Close STDERR FD

exec 2<&-

# Open STDOUT as $LOG_FILE file for read and write.

exec 1<> /tmp/nma.txt

# Redirect STDERR to STDOUT

exec 2>&1

echo "This line will appear in $LOG_FILE, not 'on screen'"

# Should end up in timer_log.log

echo "This is a message"

echxo "This is an error message!"