View Full Version : Server to Server FTP using PHP?

10-19-2004, 12:52 PM
Is this possible? I have PHP and MYSQL available and would like to 'Pull' a log file from another server on a regular basis. The transfer does not need to reset/start from the begining, I would just like to download/append the log file that alreay exsists as thefile is likely to get very large.

The FTP I need to connect to is a Secure FTP using port 22, the log file needs to reside on my webserver and requires 'updating' every 24 hours.

I do not have 'shell' access, but crontab is enabled. I would prefer though to use PHP and have an indicator on site to show the progress of the download if possible. I now this maybe a tall order, but I thought I'd ask the guru's anyway! :)

The crontab can be setup in order to do this automatically, but if the log file needs to be update as a case of importance can PHP intervene?

10-19-2004, 03:00 PM
my thoughts are...
tar the log file then copy it to a web/ftp accessible area(hopefully you have permission to use those apps)..
if it is web accessible, then you can use wget to retrieve it if you're allowed to with shell_exec
if it is ftp accessible you can use the functions located here to retrieve it: http://us2.php.net/ftp

of course, someone else may have better advice...