I am starting to think that php was not the correct language to choose for my problem and I would like to know if my issue can be done easily, or if i need to switch to perl.
I need to set a cron job to download a list of files off of a php server. So far I have written the code to : login, get a list of files available on the server, and download one file off of the server.
The files are quite large so I need to begin the download in the background.
For some reason after I start the first download, the php code stops running. This maybe because it ran into an error, the server security stopped the execution, or it is simply the way php is designed.
At the moment I am considering having a download script run every five minutes. All it does is check the database to see if a file needs to be downloaded, and start the download of that said file. Also a second script to fill the database once a night. This is of course a bad way to do this, but it is the only way I can think of doing it in PHP.
What do you think?
in case you are wondering, this is the command i am using to download the file
$command = '/usr/local/bin/wget -t 45 -o ' . "$logname $filename &";
echo exec($command);
Thanks,
Brett
Downloading Files Problem
Moderator: General Moderators
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
- Ambush Commander
- DevNet Master
- Posts: 3698
- Joined: Mon Oct 25, 2004 9:29 pm
- Location: New Jersey, US