Solved

Where does standard output go when a Cron Job executes?

Posted on 2008-10-25
3
723 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
3 Comments
 

Accepted Solution

by:
notronrj earned 100 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 25 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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Join & Write a Comment

Suggested Solutions

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…
Hi, in this article I'm going to teach you how to run your own site, and how to let people in (without IP). I'll talk about and explain each step... :) By the way, everything in this Tutorial is completely free and legal. This article is for …
This video discusses moving either the default database or any database to a new volume.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

746 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now