Gossamer Forum
Home : General : Perl Programming :

Problems with wGet

Quote Reply
Problems with wGet
Hi:

I am taking a news feed from another site, and trying to use wGet to get the file local on my machine.

I used wget from the command line, and it worked fine. I used this command:

wget http://www.theirsite/export-news.html --output-document /path/to/my/test.txt

As a command line in telnet, it works great. But when run as a cron job (which is my goal!), I get this error:

wget: not found

Not sure why- anyone got any ideas?

Should I put this in s script, and then cron the script? If I do that, I would like to run a check to make sure the file is not zero bytes, how can I do that?

I think what I would like to do, if I run a script, is run the ewget, check and make sure it is not zero bytes, and if it is not, then copy test.txt to news.txt (which is the actual file I use for the include.) Does this sound good?

Thanks!
dave

Big Cartoon DataBase
Big Comic Book DataBase
Quote Reply
Re: [carfac] Problems with wGet In reply to
Maybe you should try providing the full path to wget? Cron doesn't run from the same environment as your user account, so you can either set some env. variables with your cron job or just (easier) provide the full path.

- wil
Quote Reply
Re: [Wil] Problems with wGet In reply to
Hi Wil:

Don't think we have met before. Hi there!

Well, I will give this a shot, and see what happens tomorrow morning at 6 AM. Works fine (includnng the path, I mean!) from command line.

Thanks!
dave

Big Cartoon DataBase
Big Comic Book DataBase
Quote Reply
Re: [carfac] Problems with wGet In reply to
wget will work from ssh as it's location is set inyour path. You can see this in your .bashrc or .bash_profile file in your home directory, for example mine reads:

export PATH=~/bin:/usr/local/ghost/bin:/usr/local/bin:$PATH

cron won't recognise this and so requires the full path to be present. You could only use "wget" without the path if your cronjob script was in the same directory as wget I expect.
Quote Reply
Re: [Paul] Problems with wGet In reply to
Paul:

I suspect you are right! Well, Now I have learned something new! Thanks!
dave

Big Cartoon DataBase
Big Comic Book DataBase
Quote Reply
Re: [carfac] Problems with wGet In reply to
   
Hi everybody!

Does anybody have some experience downloading https pages with wget?
I have spent/lost 2 crazy days to find the appropriate combination of options to perform this action.
I would like to download the page https://www.boursorama.com/palmares/palmares.phtml where my username and password are 22986473 and 660883

Thanks a lot in advance.
Quote Reply
Re: [criterium] Problems with wGet In reply to
Hi,

Have you tried this?

https://22986473:660883@www.boursorama.com/palmares/palmares.phtml

?

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!