Operating System - HP-UX
1752793 Members
6026 Online
108789 Solutions
New Discussion юеВ

How to run cron job in particular terminal

 
SOLVED
Go to solution
senthil_kumar_1
Super Advisor

How to run cron job in particular terminal

Hi All,

Is it possible that we can run cron job in particular terminal.

What is the purpose of this.
8 REPLIES 8
Pete Randall
Outstanding Contributor

Re: How to run cron job in particular terminal

>What is the purpose of this.

My question exactly.


Pete

Pete
senthil_kumar_1
Super Advisor

Re: How to run cron job in particular terminal

Actually An interviewer has asked this question.
Pete Randall
Outstanding Contributor

Re: How to run cron job in particular terminal

My other question:

What do you mean by "particular terminal"?


Pete

Pete
Torsten.
Acclaimed Contributor

Re: How to run cron job in particular terminal

"What is the purpose of this. "



This is the question - can you answer it???

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Pete Randall
Outstanding Contributor
Solution

Re: How to run cron job in particular terminal

> Actually an interviewer has asked this question.

The interviewer hasn't really provided you with enough information to answer this question properly. The literal answer would have to be "no" - at least I'm unaware of any method to associate a process started by cron with a terminal. However, that does not mean that the process (script/program/whatever) cannot figure out some way to tie itself to some particular device.


Pete

Pete
James R. Ferguson
Acclaimed Contributor

Re: How to run cron job in particular terminal

Hi:

'cron' tasks are not associated with terminals! This applies to 'at' jobs too.

Regards!

...JRF...
James R. Ferguson
Acclaimed Contributor

Re: How to run cron job in particular terminal

Hi (again):

Pete's comments got me thinking creatively. You could (at least) send a message from a 'cron'task to a particular user and/or a particular user at a particular terminal.

# cat ./cronme
#!/usr/bin/sh
write senthil pts/0 < /tmp/cronme.msg
exit

# cat ./cronme.msg
Time to wake-up...
Please call me. - Thanks!

You can see how this might work by using the 'at' or 'cron' facilities to schedule the './cronme' task.

Regards!

...JRF...
Dennis Handly
Acclaimed Contributor

Re: How to run cron job in particular terminal

>JRF: Pete's comments got me thinking creatively.

If you own a terminal (from another window), you can read/write to that device from a cronjob.