Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi,
I am running a couple of perl scripts from the main shell. I have used "|| die" on all open and print commands used within the perl to trap the error. And in the main script I want to record any error messages into the log file, so i used script.pl >>logfile. But when the disk is full, the following error is printed on the screen and perl as well as the main script is exiting out successfully. I want the perl to fail and print the error in the log file.Error: msgcnt 2029 vxfs: mesg 001: vx_nospace - /dev/vg03/lvol27 file system full (1 bl
ock extent)Main script:
Scripts.pl >> $LOGFILE
k=$?
if test $k -gt 0
then
$Scripts/mailpost "failed" $mail_recipient $LOGFILE
exit 2
fi
echo "success " >> $LOGFILEPerl used:
$dir='/dir/';
$datafile=$tgt_dir.'data.out';
open(DATA,"<$datafile") || die "can't open datafile";
%files_open = ();
while ($line = <DATA>) {
$chr=($line, 7, 8);
$file_name=$chr;
if( $chr eq "A")
{
if( -e $Data4.$file_name ){
open(INFO, ">>/dir/$file_name")|| die "filesystem error";
print INFO "$line" || die "filesystem error, no space" ;
close(INFO);
}#close if
else{
open(NEW,">/dir/$file_name")|| die "filesystem error";
print NEW "$line" || die "filesystem error, no space";
close(NEW);
}#close else
}
Urgent...Any help is greatly appreciated....Thanks
vmtrt

If the disk is full, how would you expect something to write to the error file? To write to the error file, there has to be some disk space available to write the error message to.
Unless the error message is coming from a different file system.
But, in either case, I doubt that the "disk full" message is coming from your script or any programs that your script calls. The disk full message is probably coming from the operating system.
Now, take note, I did not say that your script is not causing the "disk full" message, I just said that the message is not being output by your program or anything that your program calls. The error message is coming from the OS, which your program doesn't capture output from.

I am actually the logs to different disk. so there is no space issue there.
Is there a way to capture the operating system error
Thanks .....

![]() |
command for changing uppe...
|
unix gui
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |