[ale] Cron scripts and ttys

Michael Hirsch mdhirsch at gmail.com
Thu Mar 10 12:29:11 EST 2005


On Thu, 3 Mar 2005 11:04:14 -0500 (EST), John Wells
<jb at sourceillustrated.com> wrote:
> Guys,
> 
> We have a backup cron script that running on some HP K460s that has worked
> well for many years.  In the last few weeks, our backup size has grown
> large enough to require two tapes.  Problem is, because this script runs
> as a cron job, it's not attached to any tty and there is no way to respond
> to the prompt tar throws up to tell you to change media.
> 
> Is there anyway, outside of using screen (we've had significant issues
> getting it compiled on the HPs) to get a script to run on a tty from cron?

Does someone have an X display?  You could have cron launch it to run
from an xterm displayed on the appropriate persons display.

I think you can also redirect I/O to ttys with redirecting to
/dev/tty1, or some such.  I've seen utilities for running a command on
a specific tty.  I don't have one right here, but I'm pretty sure they
exist.

Finally, you could do some interesting scripting to catch the message
from tar, fire up an xmessage window with the prompt, then push a
response back to tarwhen the xmessage gets responded to.  Again, that
assumes there is an X display somewhere.

Michael

Michael



More information about the Ale mailing list