Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Jul 2002
    Posts
    100
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Server to Server FTP using PHP?

    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?

  • #2
    fci
    fci is offline
    Senior Coder
    Join Date
    Aug 2004
    Location
    Twin Cities
    Posts
    1,345
    Thanks
    0
    Thanked 0 Times in 0 Posts
    mmmm..
    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...


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •