Computing.Net > Forums > Unix > crontab and stdout

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

crontab and stdout

Reply to Message Icon

Name: dp
Date: October 21, 2002 at 14:53:16 Pacific
OS: Solaris 8
CPU/Ram: 233 mhtz and 64 MB ram
Comment:

By default, crontab mails any output from crontab entries. Is there any way to redirect the output to std output. Like, for example, if I want to show the time on the screen every minute.

* * * * * date '+The current time is %H:%M'

the man pages say that the -l parameter will accomplish this but I'm unsure as to where to use this??

Any help is greatly appreciated.



Sponsored Link
Ads by Google

Response Number 1
Name: Don Arnett
Date: October 21, 2002 at 17:05:03 Pacific
Reply:

Crontab is a program to maintain cron files. The cron files define jobs that cron should run at specified times. When running the command 'crontab', if you add a -l parameter, it lists the contents of the current users cron file to stdout.

What you want is to get a given process to run and output the time every minute. You could use crontab to schedule the program, but the program has to do the output. But programs run by cron aren't associated with a console, so that won't work.



0

Response Number 2
Name: jimbo
Date: October 21, 2002 at 21:42:12 Pacific
Reply:

This works on Solaris 8:

Make this crontab entry:

* * * * * /path/to/script.sh > /dev/null 2>&1

Use this script:
#! /bin/sh
echo "The date is `date +%H:%M`" > /dev/console

-jim


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


Set xterm's shell script for ftp



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: crontab and stdout

Writing to logfile and stdout www.computing.net/answers/unix/writing-to-logfile-and-stdout/6584.html

Processes and Pipelining Unix www.computing.net/answers/unix/processes-and-pipelining-unix/6734.html

deciphering the crontab www.computing.net/answers/unix/deciphering-the-crontab/605.html