LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Red Hat (https://www.linuxquestions.org/questions/red-hat-31/)
-   -   directing cron output to terminal screen (https://www.linuxquestions.org/questions/red-hat-31/directing-cron-output-to-terminal-screen-830752/)

sathish167 09-07-2010 05:44 AM

directing cron output to terminal screen
 
Hi All

I am trying to display a text using crontab. My settings :
*/2 * * * * /bin/echo "hello"
This setting sends a mail to the user, instead of displaying on the screen. Now tried changing the setting to:
*/2 * * * * /bin/echo "hello" > /dev/tty1
Now I can see the text on the screen, but this setting comes with a catch. What would happen if the user changes the terminal. for instance if he gets into tty2, he wont have write access on tty1. So the user gets a mail saying "permission denied". Is there any way that I can force the user to use a particular terminal or can a cron job be set in a way such that the user would get the text irrespective of the terminal he logs in.

Thanks in advance
Cheers..

sem007 09-07-2010 05:59 AM

Quote:

Originally Posted by sathish167 (Post 4090230)
Hi All

I am trying to display a text using crontab. My settings :
*/2 * * * * /bin/echo "hello"
This setting sends a mail to the user, instead of displaying on the screen. Now tried changing the setting to:
*/2 * * * * /bin/echo "hello" > /dev/tty1
Now I can see the text on the screen, but this setting comes with a catch. What would happen if the user changes the terminal. for instance if he gets into tty2, he wont have write access on tty1. So the user gets a mail saying "permission denied". Is there any way that I can force the user to use a particular terminal or can a cron job be set in a way such that the user would get the text irrespective of the terminal he logs in.

Thanks in advance
Cheers..

Normally cron send output(error also) into mail.


have a look at below link.

http://www.linuxquestions.org/questi...rminal-727737/


All times are GMT -5. The time now is 04:56 PM.