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
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??
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
Summary: Hi all, is there a way to simultaneous writing to a logfile and to stdout? i don't want to use TEE. the problem is that i open a xterm with option -e to start another process. the output of this proce...
Summary: I am doing a program that will calculate the 199th fibonacci number using pipelines and multiple processes for each calculation. I have figured everything out except why none of the processes before t...
Summary: Has anybody ever written an awk or Perl script to sift through a complex crontab and create an output file that reads like a calendar or project plan? I would like to be able to sort out a crontab fil...