On Mon, Jul 20, 2009 at 12:13 AM, Konstantin Rozinov<[email protected]> wrote:
> Hey guys,
>
> I'm trying to run the same php script via the command line interface
> on several remote servers.
> I'd like to do it securely preferably over ssh.  Right now, I'm using
> the ssh2 class from php, but getting very inconsistent results
> (sometimes the script runs, sometimes it doesn't via ssh2_exec)
>
> What do people use to run scripts on production machines?
>
> Thanks,
> Konstantin

Cron?

If you need central command and control, as opposed to just running
the script periodically, you can still run it every 10 minutes or
something using cron, but have the script check in to a central
location via https to see what, if anything, it should do.

Also, you don't need to use the ssh class to use ssh. If your script
is interactive, you can use passthru() to execute command line ssh and
get control of password prompt and/or remote script. If not, use ssh
key authentication and exec().

Chris Snyder
http://chxor.chxo.com/
_______________________________________________
New York PHP User Group Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk

http://www.nyphp.org/show_participation.php

Reply via email to