- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Cron job not running properly?
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2000 01:01 AM
10-17-2000 01:01 AM
Cron job not running properly?
This is the second time I'm asking... Does anyone has any idea why do I keep receiving mails with subject 'cron' ??
Does it mean that my cronjob is not running properly?
Below is an example of one of the mails sent to root. Thanks !
------------------------------------------
Message 1:
From root@newmfg Fri Oct 13 14:00:00 EAT 2000
Received: (from root@localhost) by newmfg. (8.8.6 (PHNE_17190)/8.7.1) id OAA2718
2 for root; Fri, 13 Oct 2000 14:00:00 +0800 (EAT)
Date: Fri, 13 Oct 2000 14:00:00 +0800 (EAT)
From: root@newmfg
Message-Id: <200010130600.OAA27182@newmfg.>
Subject: cron
Status: RO
stty: : Not a typewriter
*************************************************
Cron: The previous message is the standard output
and standard error of one of your crontab commands:
/mfgpro/admin/batch/hourly_dga > /mfgpro/batch/hourly_dga.mon
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2000 01:08 AM
10-17-2000 01:08 AM
Re: Cron job not running properly?
Try eliminating 'stty' and 'tty' from executing
script ( cron does not have an output channel) if these entries exist or post the script to the forum.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2000 01:10 AM
10-17-2000 01:10 AM
Re: Cron job not running properly?
it actually tells you at the bottom of the mail that the message is the Standard Out and Standard Error from your cron job.
It looks like the job is actually running , if you don't want the mail , put standard out and standard error either to a files (or files) or to /dev/null , in the crontab file
eg
.... your cron entry > /tmp/out 2>&1
or
.... your cron entry > /tmp/out 2>/tmp/error
or
.... your cron entry >/dev/null 2>&1
hope this helps
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2000 01:11 AM
10-17-2000 01:11 AM
Re: Cron job not running properly?
This behavior is "expected". Several recent thread have explained why this happens (under various circumstances) and how to eliminate the behavior. See:
http://my1.itrc.hp.com/cm/QuestionAnswer/1,1150,0x73e66c96588ad4118fef0090279cd0f9,00.html
http://my1.itrc.hp.com/cm/QuestionAnswer/1,1150,0x0c0c6d96588ad4118fef0090279cd0f9,00.html
From the command line you posted, I might guess that your script uses 'stty' in it. If that is the case you should execute it conditionally by building a test: [-t -eq 0].
Hopefuly this answers your question.
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2000 01:12 AM
10-17-2000 01:12 AM
Re: Cron job not running properly?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2000 01:13 AM
10-17-2000 01:13 AM
Re: Cron job not running properly?
you could also redirect error messages to your outputfile with crontab entry:
/mfgpro/admin/batch/hourly_dga > /mfgpro/batch/hourly_dga.mon 2>&1
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2000 01:16 AM
10-17-2000 01:16 AM
Re: Cron job not running properly?
It looks as though your script is issuing a command of the form 'su -c
By default, the .profile script runs 'stty' which fails as it is not connected to a terminal causing your message.
There are a couple of workarounds:-
1. change 'su -
2. Put a test around the stty statements in .profile to stop them running if no terminal is associated - of the form:-
if [[ -t 1 ]];
then stty ...
fi
Regards,
John
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2000 04:02 AM
10-17-2000 04:02 AM
Re: Cron job not running properly?
to file using 2> or if you want to write error to output file then
use 2>&1 at the end of the command.
like
script_name > output_file_name 2>&1 (this is to write the error to the output file name)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2000 04:36 AM
10-17-2000 04:36 AM
Re: Cron job not running properly?
Your messages are generated from the stty command. This command either is trying to change terminal behavior but when doing by cron there is no terminal assosiated with a terminalor or is using the su command and a
$HOME/.profile is executed.
In order to fix this put for any stty commands (in .profile ) :
if [ -t ]
then
stty .....
fi
This way the stty command will be executed only if associated to a terminal.
Regards,
federico