[wplug] cron job whose action is promted?

Chad Ziccardi ziccardi at digitalfreaks.org
Sun Nov 14 23:55:56 EST 2004


begin quote from Russ Schneider <russ at sugapablo.com> written 2004-11-14:

> 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.
>
> Anything I can do to get the cron job to respond to the prompt?  (I know,
> wierd question.)

You could do it on the command line, however that could expose it if others 
have access to see processes on whichever box you are running cron from.

A better option would be (imo)

http://dev.mysql.com/doc/mysql/en/Option_files.html

You can setup a coBnf file to store the password.

~/.my.cnf

[client]
port=3306
socket=/path/to/mysql.sock
password="passwordhere"

If you need to do the prompts, write an expect script.

-- 
Chad Ziccardi, Professional Slacker          cz at digitalfreaks.org
"Some cause happiness wherever they go; others whenever they go."


More information about the wplug mailing list