Operating System - HP-UX
1833758 Members
3070 Online
110063 Solutions
New Discussion

Script csh not run on crontab!

 
pavenvn
Occasional Contributor

Script csh not run on crontab!

A dba_stats.sh script:

#!/bin/csh -f

# Set the current month day and year.
set month=`date +%m`
set day=`date +%d`
set year=`date +%Y`
set hour=`date +%H`
set minute=`date +%M`
set second=`date +%S`

set YMDHMS=$year$month$day$hour$minute$second

set glancetmp = /ccbs2/stats_raw/ccbs2_glance_$YMDHMS.tmp
set glancetxt = /ccbs2/stats_raw/ccbs2_glance_$YMDHMS.txt
set toptmp = /ccbs2/stats_raw/ccbs2_top_$YMDHMS.tmp
set toptxt = /ccbs2/stats_raw/ccbs2_top_$YMDHMS.txt

# Create tmp files
/opt/perf/bin/glance -adviser_only -iterations 2 -j1 -syntax /ccbs2/cron/glance.syntax > $glancetmp
top -d 1 -f $toptmp

# Rename to txt files
mv $glancetmp $glancetxt
mv $toptmp $toptxt

I put this script into crontab and set run every 2 min.

0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58 * * * * /ccbs2/cron/dba_stats.sh

The script have run well for 3 months. But at Oct 6th 2005 08:32:00 it didn't run. vi /var/mail/oss before and after error:

===================== GlancePlus Non-Fatal Error =====================
Version:
User : oss Date: Thu Oct 6 08:32:00
File : /crm/gp/source/glance/glance.c Line: 955
System : COVIS1 B.11.00 9000/800

Unable to perform functions on devices.
======================================================================


===================== GlancePlus Non-Fatal Error =====================
Version: B3692A GlancePlus C.03.55.00
User : oss Date: Thu Oct 6 08:32:04
File : /crm/gp/source/glance/glance.c Line: 978
System : COVIS1 B.11.00 9000/800

Unable to perform functions on devices.
======================================================================


===================== GlancePlus Non-Fatal Error =====================
Version: B3692A GlancePlus C.03.55.00
User : oss Date: Thu Oct 6 08:32:04
File : /crm/gp/source/glance/glance.c Line: 980
System : COVIS1 B.11.00 9000/800

Unable to perform functions on devices.
======================================================================






*************************************************
Cron: The previous message is the standard output
and standard error of one of your crontab commands:

/ccbs2/cron/dba_stats.sh


From oss@COVIS1 Thu Oct 6 03:47:03 EDT 2005
Received: (from oss@localhost) by COVIS1 (8.7.6/8.7.1) id DAA03151 for oss; Thu, 6 Oct 2005 03:47:02 -0400 (EDT)
Date: Thu, 6 Oct 2005 03:47:02 -0400 (EDT)
From: oss@COVIS1
Message-Id: <200510060747.DAA03151@COVIS1>

A copy of an editor buffer of your file "setenv"
was saved when the editor was killed.
This buffer can be retrieved using the "recover" command of the editor.
An easy way to do this is to give the command "ex -r setenv".
This works for "edit" and "vi" also.


From root@COVIS1 Fri Oct 7 12:16:00 TST 2005
Received: (from root@localhost) by COVIS1 (8.7.6/8.7.1) id MAA02670 for oss; Fri, 7 Oct 2005 12:16:00 +0700 (TST)
Date: Fri, 7 Oct 2005 12:16:00 +0700 (TST)
From: root@COVIS1

This script is OK when run manual but not run when put on crontab :(. Please help me!
3 REPLIES 3
RAC_1
Honored Contributor

Re: Script csh not run on crontab!

Is it running fine now?? did you have problem at the time when this script did not run??

Did you look at syslog.log at around the time when the script did not run?
There is no substitute to HARDWORK
pavenvn
Occasional Contributor

Re: Script csh not run on crontab!

The dba_stats.sh script was written for my monitoring program. The monitor program help the people who work on Windows platform (not using X-Windows telnet/ssh HPUX) can collect and monitor the system performance (CPU,DISK I/O,MEMORY,TOP Process, vmstat,iostat, ...). My program have 3 parts:
- 1 or more scripts on HPUX
- 2 clients on Windows:
+ FTP client: transfer data on HPUX to Windows
+ Process client: processing data and put into Database
- Monitoring Program: (monitor.exe) run on any Windows to monitor.

I have just solved this problem by restarting the Windows which FTP program & Process program run on. But I don't know exactly that this is the problem?

Kent Ostby
Honored Contributor

Re: Script csh not run on crontab!

include the -bootup option along with the -advisor_only option and it will take care of these errors.

Best regards,

Oz
"Well, actually, she is a rocket scientist" -- Steve Martin in "Roxanne"