Solved

Where does standard output go when a Cron Job executes?

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

Manage your data center from practically anywhere

The KN8164V features HD resolution of 1920 x 1200, FIPS 140-2 with level 1 security standards and virtual media transmissions at twice the speed. Built for reliability, the KN series provides local console and remote over IP access, ensuring 24/7 availability to all servers.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Post form data to PHP then to 3rd party site 19 42
Leverage Browser Caching 7 75
Laravel Forge - What is it? (But in non-developer language:) ) 3 90
.htaccess file settings 4 63
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). #…
If your site has a few sections that need to be secure when data is transmitted between the server and local computer, such as a /order/ section for ordering or /customer/ which contains customer data, etc it would of course be recommended to secure…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

838 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