Sponsored Content
Full Discussion: cron issue
Operating Systems Linux Red Hat cron issue Post 302299576 by mgb on Friday 20th of March 2009 11:43:54 AM
Old 03-20-2009
Question cron issue

Hello,

Having and issue with a job scheduled in cron. The script:

Code:
#!/bin/bash
2 	
3 	#  Example shell script which can be added to roots cron job to check the
4 	# Embedded Satellite disk space usage. If any table is over 90% usage, send
5 	# a notice to the default email address configured within the Satellite.
6 	
7 	#
8 	# This script is supplied as a working example and is not supported by Red Hat
9 	#
10 	
11 	# Example cron entry:
12 	# 1 */6 * * * /root/check-oracle-space-usage.sh
13 	
14 	PATH=/usr/bin:/bin
15 	export PATH
16 	
17 	reportusage() {
18 	   /sbin/runuser - oracle -c "db-control report"
19 	}
20 	
21 	mailitout() {
22 	   #get Satellite email address
23 	   MAILADDRESS=`grep "traceback_mail" /etc/rhn/rhn.conf | awk '{print $3}'`
24 	
25 	   SUBJECT="Warning - high tablespace usage on Satellite oracle DB"
26 	
27 	   BODY="This is a notice to let you know that you have gone over 90% usage in
28 	one of the Oracle Tablespaces. We recommend to be proactive and increase the
29 	size of the tablespace  before getting to 100% usage. Please consult
30 	the Satellite documentation on using db-control to increase the size or
31 	contact Red Hat Support for assistance."
32 	
33 	   ( echo $BODY; echo ; reportusage ) | mail -s "$SUBJECT" $MAILADDRESS
34 	   exit 0
35 	}
36 	#grab the usage numbers from the db-control report output
37 	NUMBERS=`reportusage | awk '{print $5}'|sed '1d'| sed 's/%//g'`
38 	# run db-control and then use awk and sed to get the % numbers
39 	for num in $NUMBERS
40 	   do
41 	   # if number is over 90% then send warning email
42 	   if [ $num -gt 90 ]
43 	      then mailitout
44 	   fi
45 	done
46 	exit 0

Running this out of /etc/cron.daily and getting this error:

stty: standard input: Inappropriate ioctl for device

I suspect this is due to something not being re-directed to /dev/null.

Any ideas?

Thanks,

mgb
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

cron issue

user x has a cron job that looks in a dir and moves teh files from 1 name to another except its not working correctly. . /user/.profile # sorce the users profile for file in `ls`; do mv $file $file.`date +%Y%m%d%H%M%S``microsec` done microsec is a binary with 555 perm. on it in... (5 Replies)
Discussion started by: Optimus_P
5 Replies

2. Solaris

Cron issue

When I list whats in cron -l its fine but when I try to -e edit it...it returns a number 309 can't you not edit cron this way with solaris 10? I can do it fine in sol 8 and 9. export EDITOR="vi" is set in my profile I am using BASH $ sudo crontab -l Password: #ident "@(#)root ... (5 Replies)
Discussion started by: kingdbag
5 Replies

3. Shell Programming and Scripting

A Cron Issue

Hi Guys.,, This thing is driving me crazy.. I have this script which runs perfectly fine. If it is not able to connect to database it will drop a mail which it does when i ran it manually. But when i am running it from crontab, the script is not sending mail to me but to my id(login id)... (0 Replies)
Discussion started by: mac4rfree
0 Replies

4. Red Hat

Cron Issue

Hey all! I'm working on setting up a script to run with cron. I have thus far been unable to get it to successfully complete. I'm hoping you gurus can lend me a hand. This is my crontab, the transfer script works fine the backup will not. The backup however does work when I execute it from the... (11 Replies)
Discussion started by: spiffyville
11 Replies

5. Shell Programming and Scripting

Issue with Cron

Hi Gurus, I need to run a script every saturday at 7:05 PM. Below command is working in x86_64. 05 19 * * 6 /apps/informatica/scripts/inf_rest.ksh However when I tried in HP-UX it is giving the below error. crontab: error on previous line; unexpected character found in line. Please... (4 Replies)
Discussion started by: svajhala
4 Replies

6. UNIX for Advanced & Expert Users

Cron Issue

I have written a custom cron. This cron executes a rake task every 5 minutes. I also log the trace of this execution in a file locally on my server. The whole process seems to execute seamlessly every 5 minutes, but then it seems to log it in /var/log/syslog. I investigated on the syslog and found... (0 Replies)
Discussion started by: manjunath.nm89
0 Replies

7. UNIX for Dummies Questions & Answers

Cron Issue

I have written a custom cron. This cron executes a rake task every 5 minutes. I also log the trace of this execution in a file locally on my server. The whole process seems to execute seamlessly every 5 minutes, but then it seems to log it in /var/log/syslog. I investigated on the syslog and found... (0 Replies)
Discussion started by: manjunath.nm89
0 Replies

8. Ubuntu

Cron Issue

I have written a custom cron. This cron executes a rake task every 5 minutes. I also log the trace of this execution in a file locally on my server. The whole process seems to execute seamlessly every 5 minutes, but then it seems to log it in /var/log/syslog. I investigated on the syslog and found... (3 Replies)
Discussion started by: manjunath.nm89
3 Replies

9. Solaris

CRON Issue

Hello, I am running Solaris 8. I have set a cron job that runs every couple hours. If I run the script manually, it runs just fine (logged in as root). The cron however will not run. It is producing an rc=1 error. Any thoughts would be appreciated. Thanks (4 Replies)
Discussion started by: jkmtm
4 Replies

10. Shell Programming and Scripting

Cron issue

i have written a script to sftp yesterday's logs from another server as below: cd /export/home/abc/xyz/tt d=`gdate -d'yesterday' +%Y%m%d` sftp abc@XXX.XX.XX.XX<<EOF cd /yyy/logs/archive mget abc.log.$d* EOF cd /export/home/abc/xyz/scripts nohup ./ss.sh PROD & it is working fine... (2 Replies)
Discussion started by: ssk250
2 Replies
uudemon(4)						     Kernel Interfaces Manual							uudemon(4)

NAME
uudemon.admin, uudemon.cleanu, uudemon.hour, uudemon.poll - Administrative shell scripts for polling remote systems, cleaning up spool directories, reporting status to the system administrator, and routine invocations of the uuxqt and uusched daemons SYNOPSIS
These shell scripts reside in the following directory: /usr/lib/uucp DESCRIPTION
All the scripts can be run from the command line or can be run automatically by the cron daemon. To automatically run the scripts, remove the comment character (#) from the beginning of the relevant line in the /var/spool/cron/crontabs/uucp file. This script reports status to the system administrator. It issues the uustat command to find out the status of uucp jobs. It mails the results to the uucp login ID. The script may be modified to send mail to any login ID such as the uucp administrative login ID (uucpa) or root. This script cleans up the /var/spool/uucp and /var/spool/uucppublic directories by running the uucleanup command. The uucleanup com- mand is run with the following parameters: -C7, -D7, X2, -o2, -W1. This script runs the uusched and uuxqt daemons in the background. This script polls the systems listed in the /usr/lib/uucp/Poll file. The uudemon.poll script should be scheduled before the uudemon.hour script. This allows uudemon.poll to create any command files before cron runs the uudemon.hour script. FILES
Contains the uudemon.admin, uudemon.cleanu, uudemon.hour and uudemon.poll files. Contains the uucp file. RELATED INFORMATION
Commands: cron(8), uucleanup(8), uusched(8), uuxqt(1) Files: /usr/lib/uucp delim off uudemon(4)
All times are GMT -4. The time now is 04:17 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy