- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Getting a message "mesg: not a tty" from cron (roo...
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
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
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
тАО11-04-2002 09:57 AM
тАО11-04-2002 09:57 AM
Recently, my root's mailbox had an overflow. However, I am starting to get these messages from our cron jobs (mesg: not a tty). Any idea of why or how to resolve it?
This is for jobs that should not be producing output unless there is actually an error on the script.
============================================
From root@hostname.domain.com Mon Nov 4 12:22:18 EST 2002
Received: (from root@localhost)by hostname.domain.com (8.9.3 (PHNE_24419)/8.9.3) id MAA01501 for root; Mon, 4 Nov 2002 12:22:17 -0500 (EST)
Date: Mon, 4 Nov 2002 12:22:17 -0500 (EST)
From: root@hostname.domain.com
Message-Id: <200211041722.MAA01501@hostname.domain.com>
Subject: cron
mesg: not a tty
mesg: not a tty
***********************************************Cron: The previous message is the standard output and standard error of one of your ccrontab commands:
/usr/rcsd/bin/chk_syslinks.sh
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-04-2002 10:02 AM
тАО11-04-2002 10:02 AM
Re: Getting a message "mesg: not a tty" from cron (root's mail)
"This is most likely due to the fact that you are sourcing a file, like a users .profile, that is attempting to set environment variables that are designed to be used with an interactive terminal and not with a non-interactive terminal like a cron job. "
Now, you said that this just started happening. The first question I'll ask is: What changed?
Did you make a change to something like .profile or any other . files that a cron job may source? Things don't usually change the way they behave without something else changing somewhere.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-04-2002 10:07 AM
тАО11-04-2002 10:07 AM
Re: Getting a message "mesg: not a tty" from cron (root's mail)
What happens if there is an error , does it write to the error log ? and not give the tty message ? If so , try and redirect stdout within your cron job to /dev/null or a character device file
HTH
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-04-2002 10:30 AM
тАО11-04-2002 10:30 AM
Re: Getting a message "mesg: not a tty" from cron (root's mail)
What seemed normal (resulted from an error encountered during execution -- No errors = no message):
From root@hostname.domain.com Sun May 12 17:40:03 EDT 2002
Received: (from root@localhost) by hostname.domain.com (8.9.3 (PHNE_24419)/8
.7.1) id RAA03453 for root; Sun, 12 May 2002 17:40:03 -0400 (EDT)
Date: Sun, 12 May 2002 17:40:03 -0400 (EDT)
From: root@hostname.domain.com
Message-Id: <200205122140.RAA03453@hostname.domain.com>
Subject: cron
Status: O
cat: Cannot open /tmp/get_date.3438: No such file or directory
cat: Cannot open /tmp/get_date.3443: No such file or directory
*************************************************
Cron: The previous message is the standard output
and standard error of one of your crontab commands:
/usr/rcsd/bin/wcanjobs.sh # WCAN Tasks
=============================================
What I get now:
From root@hostname.domain.com Mon Nov 4 13:20:01 EST 2002
Received: (from root@localhost)
by hostname.domain.com (8.9.3 (PHNE_24419)/8.9.3) id NAA08811
for root; Mon, 4 Nov 2002 13:20:01 -0500 (EST)
Date: Mon, 4 Nov 2002 13:20:01 -0500 (EST)
From: root@hostname.domain.com
Message-Id: <200211041820.NAA08811@hostname.domain.com>
Subject: cron
mesg: not a tty
*************************************************
Cron: The previous message is the standard output
and standard error of one of your crontab commands:
/usr/rcsd/bin/wcanjobs.sh # WCAN Tasks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-04-2002 10:35 AM
тАО11-04-2002 10:35 AM
Re: Getting a message "mesg: not a tty" from cron (root's mail)
However, since this new problem is seen as an error I am getting a message every time the jobs run.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-04-2002 11:34 AM
тАО11-04-2002 11:34 AM
Re: Getting a message "mesg: not a tty" from cron (root's mail)
I agree with Patrick, what's changed? I'd be looking through the cron'd script to find out what's calling the 'mesg' command. This is designed only to be run in a terminal session and has no meaning in a cron's job.
Are you sure you're not running su -
Regards,
John
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-04-2002 11:47 AM
тАО11-04-2002 11:47 AM
Re: Getting a message "mesg: not a tty" from cron (root's mail)
=========================================
00,10,20,30,40,50 * * * * /usr/rcsd/bin/chk_syslinks.sh
20,40 * * * * /usr/rcsd/bin/wcanjobs.sh # WCAN Tasks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-04-2002 11:51 AM
тАО11-04-2002 11:51 AM
Re: Getting a message "mesg: not a tty" from cron (root's mail)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-04-2002 11:56 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-04-2002 12:11 PM
тАО11-04-2002 12:11 PM
Re: Getting a message "mesg: not a tty" from cron (root's mail)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-04-2002 12:22 PM
тАО11-04-2002 12:22 PM
Re: Getting a message "mesg: not a tty" from cron (root's mail)
if [[ -t 1 ]];
then mesg -y
fi
This will only call mesg if standard output (file 1) is associated with a terminal.
Regards,
John
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-04-2002 12:27 PM
тАО11-04-2002 12:27 PM
Re: Getting a message "mesg: not a tty" from cron (root's mail)
I see your last reply, is that the answer?
Thanks everyone!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-04-2002 12:34 PM
тАО11-04-2002 12:34 PM
Re: Getting a message "mesg: not a tty" from cron (root's mail)
Regards,
John