View Single Post
Old 2nd November 2006, 09:01
Ben Ben is offline
Join Date: Jul 2006
Posts: 1,029
Thanks: 7
Thanked 62 Times in 56 Posts

Just for the access and executing commands you do not need php on the windows box, because running commands on the linux box you can simply do with an ssh client.
This command will list files older than 30 days in the specified dir... nearly the same way you could run a script.

ssh find /export/home/*.dmp -ctime +30
But sometimes you need to source your userprofile first, before executing any script:
ssh ". /usr/local/etc/profile; /export/home/local/service stop; sleep 20; /export/home/local/service start\"
So this example shows how to run more than one command in a sequence.

If you now wish to run systemcommands out of your php script, you can e.g. do that with `` (backtiks), exec(), system(), etc... for more see the crosslinks to that commands on

EDIT: And that thread ( gives you an example how you can directly do an ssh connection with php...

Last edited by Ben; 2nd November 2006 at 09:03.
Reply With Quote