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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem using notifcations to execute a perl script

Status
Not open for further replies.

tracknode

IS-IT--Management
Joined
Apr 29, 2005
Messages
1
Location
US
Hi,

I'm try to get my Networker server (7.1.2) to execute a perl script when it has finished backing up a savegroup. To do this I've set up a notification (event=savegroup, priority=notice) that has the following action "/usr/bin/perl /usr/local/nsrscripts/initclone.pl". When I ran a backup on a group however, it does not seem like this script gets executed.

Currently, just for testing purposes, the script just dumps whatever is in STDIN to a file:

#!/usr/bin/perl
$report = <STDIN>;
open (REPORT, '>/usr/local/nsrscripts/report.txt') or die "Couldn't create file: $!\n";
print REPORT "$report\n";
close REPORT;

When I run this script from the command line, it creates the file with whatever I put in STDIN. However, no file is created when Networker performs a backup. If I change the action of the notification to "cat>/usr/local/nsrscripts/report.txt" the file is created.

I've set the permissions wide open on the script and the directory it's in.

Any thoughts?

--
Brian Kunst
Asst. Systems Administrator
Pacific Lutheran University
 
I would assume that each action you do overwrites STDIN. I would first use nsrlog so save the output and then append (pipe) whatever command.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top