Thanks for the insight.

My other idea was to tar the whole thing, ftp it, and try to untar at the other end. Problem is that I don't have that kind of access there.
Guess I'll have to play a bit to see how far I can get!

steve


On Mar 7, 2007, at 12:32 PM, Sheila Fenelon wrote:

The commandline ftp doesn't take parameters in that form. Here's the man page http://nersp.cns.ufl.edu/~dicke3/nerspcs/ftp.html

Shell scripts I've seen to automate ftp looks like this

ftp -i -v -n hostname <<END_FTP

user username userpass
binary
lcd /path_to_download_dir
cd /path_to_save_dir
get filename
bye

END_FTP


Transferring multiple files is more involved.

Using exec in PHP would required some tricks to keep it from waiting for the command to finish. If it sits and waits then you're back to the timeout issue. On the other hand if you put it in a loop and let it spawn an ftp session for every file at once you quickly consume all the resources on the machine, and your host gets mad.


Sheila
http://www.shefen.com

steve miller wrote:
Kind of makes sense.
I have run scripts from crons before, so that part I know how to do.
The timeout issue was the problem, and it might be the server config; I'm not sure. What I was thinking was that I could run an exec within php that executes the ftp statement like on a command line, but I don't know the correct syntax.
Something like:
exec (" ftp ftp://user:[EMAIL PROTECTED]/path path/to/files/*.* ")
Would this work?
On Mar 7, 2007, at 11:30 AM, Sheila Fenelon wrote:
You could start by running the PHP script via cron. If the timeout you got was from the web server's configuration then it might not timeout when run from cron.

To run a PHP script from cron you first give the path to php then the path to the script, so depending on your server setup, it would look *something* like this

/usr/local/bin/php /full_path_to_ftp_script/the_script.php

If it still times out you could try wrapping the call to the php script in a shell script. The shell script would need to generate or read a list of the files to be ftp'd and pass them to the php script. The php script would need to read the input, handle just one file and then exit.

Hope the makes sense,
Sheila





____ • The WDVL Discussion List from WDVL.COM • ____
To Join wdvltalk, Send An Email To: mailto:[EMAIL PROTECTED] dl.sparklist.com or use the web interface http://e-newsletters.internet.com/ discussionlists.html/
      Send Your Posts To: [email protected]
To change subscription settings, add a password or view the web interface:
http://intm-dl.sparklist.com/read/?forum=wdvltalk

________________  http://www.wdvl.com  _______________________

You are currently subscribed to wdvltalk as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
To unsubscribe via postal mail, please contact us at:
Jupitermedia Corp.
Attn: Discussion List Management
475 Park Avenue South
New York, NY 10016

Please include the email address which you have been contacted with.



____ • The WDVL Discussion List from WDVL.COM • ____
To Join wdvltalk, Send An Email To: mailto:[EMAIL PROTECTED] or
use the web interface http://e-newsletters.internet.com/discussionlists.html/
      Send Your Posts To: [email protected]
To change subscription settings, add a password or view the web interface:
http://intm-dl.sparklist.com/read/?forum=wdvltalk

________________  http://www.wdvl.com  _______________________

You are currently subscribed to wdvltalk as: unknown lmsubst tag argument: ''
To unsubscribe send a blank email to [EMAIL PROTECTED]
To unsubscribe via postal mail, please contact us at:
Jupitermedia Corp.
Attn: Discussion List Management
475 Park Avenue South
New York, NY 10016

Please include the email address which you have been contacted with.

Reply via email to