Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place! |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
12-02-2009, 07:46 PM
|
#1
|
Member
Registered: Mar 2009
Distribution: Slackware 13.37 - Stable
Posts: 61
Rep:
|
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
Last edited by igxz; 12-02-2009 at 08:04 PM.
|
|
|
12-02-2009, 07:54 PM
|
#2
|
Moderator
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
|
Because each shell, including crons, has its OWN STDOUT, which, in crons
case, isn't attached to a terminal.
Cheers,
Tink
|
|
|
12-02-2009, 08:06 PM
|
#3
|
Member
Registered: Mar 2009
Distribution: Slackware 13.37 - Stable
Posts: 61
Original Poster
Rep:
|
thanks for your explanation Tink, so there is no way to echo anything to standard output, is there? thx
regards
Stephen Z
Quote:
Originally Posted by Tinkster
Because each shell, including crons, has its OWN STDOUT, which, in crons
case, isn't attached to a terminal.
Cheers,
Tink
|
|
|
|
12-02-2009, 09:52 PM
|
#4
|
LQ Guru
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,397
|
|
|
|
12-03-2009, 02:27 PM
|
#5
|
Member
Registered: Mar 2009
Distribution: Slackware 13.37 - Stable
Posts: 61
Original Poster
Rep:
|
that would work! thanks
Quote:
Originally Posted by chrism01
|
|
|
|
12-03-2009, 02:55 PM
|
#6
|
LQ 5k Club
Registered: Sep 2009
Posts: 6,443
|
Try:
Code:
1-59 * * * * echo "Reminder: One minute has passed!" | wall
Or a funnier version (if you have cowsay):
Code:
1-59 * * * * cowsay "Reminder: One minute has passed!" | wall
|
|
|
All times are GMT -5. The time now is 11:32 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|