Solved

Where does standard output go when a Cron Job executes?

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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

Suggested Solutions

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 …
If you've heard about htaccess and it sounds like it does what you want, but you're not sure how it works... well, you're in the right place. Read on. Some Basics #1. It's a file and its filename is .htaccess (yes, with a dot in the front). #…
Delivering innovative fully-managed cloud services for mission-critical applications requires expertise in multiple areas plus vision and commitment. Meet a few of the people behind the quality services of Concerto.
A company’s greatest vulnerability is their email. CEO fraud, ransomware and spear phishing attacks are the no1 threat to a company’s security. Cybercrime is responsible for the largest loss of money to companies today with losses projected to r…

932 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