[wplug] cron job whose action is promted?
Jonathan S. Billings
billings at negate.org
Sun Nov 14 22:32:01 EST 2004
On Nov 14, 2004, at 10:13 PM, Russ Schneider wrote:
> What can you do if you want to do a cron job where the command is
> prompted?
>
> Specifically, I want to set up a mysqldump as a cron job, but if I do a
> mysqldump, I get prompted for a password.
Actually, you don't need to do that, 'mysqldump' can use the following
flag:
--password[=password], -p[password]
So you don't actually need to deal with the prompt.
> Anything I can do to get the cron job to respond to the prompt? (I
> know,
> wierd question.)
If you don't have any other choice, you can use 'expect' or perl's
Expect.pm, which lets you wrap interactive programs using a tcl or perl
interface, respectively.
Expect's web page: http://expect.nist.gov/
Expect.pm's documentation:
http://search.cpan.org/~rgiersig/Expect-1.15/Expect.pod
(you can download Expect out of CPAN).
Jonathan
More information about the wplug
mailing list