Solved

Where does standard output go when a Cron Job executes?

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

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
apache and php 3 160
Clearing cache in word press. 3 73
How to access multiple local hosts from phone on network 5 100
DNS CNAME records visibility on a web server 2 66
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…
It is possible to boost certain documents at query time in Solr. Query time boosting can be a powerful resource for finding the most relevant and "best" content. Of course the more information you index, the more fields you will be able to use for y…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …
Suggested Courses

739 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