Forum Moderators: coopster

Message Too Old, No Replies

How to execute command on remote host?

How to execute command on remote host?

         

Slait

2:49 pm on Apr 17, 2005 (gmt 0)

10+ Year Member



Hello everybody,
I'm trying to execute command on remote host. In my case firstly I should go to the proper directory /home/user/destination_directory and than make an archive of the files and upload it back on the server.
With ssh I can make an archive with ssh_exec($conn_id ,'tar ...'), but I dont know how to change directory first.
With ftp I can change directory with ftp_chdir() but the ftp_exec doesn't work how I want. It posts Unknown SITE command when I put ftp_exec($conn_id,'tar...); so ftp server doesnt recognize this command.
I also can't use ftp_raw() course it's from PHP 5
Can anybody help me pls?

jd01

9:02 am on Apr 18, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Not sure I understand what you need...

I think you trying to find a directory (via /path/to/directory/), then archive that directory, then re-uppload from the archive - all from a remote location?

EG once a week you run a php-app. that archives your site and then reloads it.

Or, am I missing it completely?

Justin