cron question
hi fellows,
I am newbie of cron, and I set following cron expression using crontab -e, 1-59 * * * * echo "THIS RUNS EVERY MINUTE TO STANDARD OUTPUT!" but it was not printed out on standard output as I was expecting, I know it did run base on cron log says ----------------- tail of /var/log/cron ---------------------- Dec 3 14:42:01 bustest1 crond[302]: (root) RELOAD (cron/root) Dec 3 14:42:01 bustest1 crond[1936]: (root) CMD (echo "THIS RUNS EVERY MINUTE TO STANDARD OUTPUT!") -------------------------------------------------------------- just wondering why it didn't appear in standard output? thanks in advance! regards Stephen Z |
Because each shell, including crons, has its OWN STDOUT, which, in crons
case, isn't attached to a terminal. Cheers, Tink |
thanks for your explanation Tink, so there is no way to echo anything to standard output, is there? thx
regards Stephen Z Quote:
|
You may want to try this http://linux.die.net/man/1/wall or http://linux.die.net/man/1/write
|
that would work! thanks
Quote:
|
Try:
Code:
1-59 * * * * echo "Reminder: One minute has passed!" | wall Code:
1-59 * * * * cowsay "Reminder: One minute has passed!" | wall |
All times are GMT -5. The time now is 09:57 AM. |