Web Hosting Talk







View Full Version : Cron + wget + PHP = confused guy !


Badie
02-18-2007, 03:47 AM
Hi,
I'm beginner with these stuff, I want to learn ... I have few question , First its better to explain what I'm trying to do :

I need to write a script do the following :

1- Download 5 files ziped with extension .gz
2- Extract them, then update MySQL database.
3- Email report that the process is succeeds or not.

This process should execute each day 2 times.

=====================================

The Problem: How to download 5 files on my host automatically each day 2 times?
To used shell command I open Putty.exe Then I login into my host with my user name and password, then i execute
[Mydomain.com@hostingCompanyServerName ~]$ wget http://domain/path/to/file.gz

then I open my host via ftp and I found the file , I download it , the gz file was empty!, I try to download it via IE , the file was fine and contain the data.

Question is why the file empty? And how I can download the file by wget? And how can I adjust the time for the execute time

Thanks a lot

tanfwc
02-18-2007, 04:25 AM
maybe try using this command

curl -OL http://domain/path/to/file.gz

Badie
02-18-2007, 04:40 AM
Hi,
I Try what you write now , still same problem

% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 12 0 12 0 0 52 0 --:--:-- --:--:-- --:--:-- 0