?
Solved

Where does standard output go when a Cron Job executes?

Posted on 2008-10-25
3
Medium Priority
?
779 Views
Last Modified: 2010-04-21
Just a quick question...

I have a Perl script that performs DB related maintenance routines and writes out status to standard output. If I execute the script using a Cron Job, where would I look to find the status messages?

Thanks,

Bob
0
Comment
Question by:yamabob217
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 

Accepted Solution

by:
notronrj earned 400 total points
ID: 22805682
On most Linux systems the non-redirected output of a cron executed script gets mailed to the owner of the process that produced the output unless the variable MAILTO is set to some user.

Here is a nice description of how Vixie-cron works on a redhat system. I'm assuming your system uses Vixie-cron. If not many of these concepts are the same for other cron implementations.

http://www.unixgeeks.org/security/newbie/unix/cron-1.html

Hope this helps you out Bob.
0
 
LVL 13

Assisted Solution

by:Xyptilon2
Xyptilon2 earned 100 total points
ID: 22806894
Notronrj is right, Just an extra, add "2>&1" (without quotes) to have STDERR also redirected to the same descriptor as STDOUT. (which is useful for catching errors that are otherwise difficult to detect when something runs as root).
0
 

Author Closing Comment

by:yamabob217
ID: 31510024
Thanks a lot!
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

As Wikipedia explains 'robots.txt' as -- the robot exclusion standard, also known as the Robots Exclusion Protocol or robots.txt protocol, is a convention to prevent cooperating web spiders and other web robots from accessing all or part of a websit…
Introduction As you’re probably aware the HTTP protocol offers basic / weak authentication, which in combination with the relevant configuration on your web server, provides the ability to password protect all or part of your host.  If you were not…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses
Course of the Month13 days, 13 hours left to enroll

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question