Programming Theory
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesProgramming Theory

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here!
  #1  
Old February 15th, 2004, 08:41 PM
Andrew's Avatar
Andrew Andrew is offline
Moderator
Click here for more information
 
Join Date: Apr 2007
Location: United Kingdom
Posts: 1,937 Andrew User rank is Private First Class (20 - 50 Reputation Level)Andrew User rank is Private First Class (20 - 50 Reputation Level)  Folding Points: 2429 Folding Title: Novice Folder
Time spent in forums: 4 Days 1 h 57 m 37 sec
Reputation Power: 3
Orkut
Another Way?

Hey i have a cronjob set to run every 24 hours and to use wget to run a php script which sends emails out to users about a certain topic they have selected. This all works fine but in my root folder (above public_html) it stores a copy of the php file wget runs and i want to know is there a way of not making it download to the root folder?

Reply With Quote
  #2  
Old February 15th, 2004, 08:42 PM
Andrew's Avatar
Andrew Andrew is offline
Moderator
Click here for more information
 
Join Date: Apr 2007
Location: United Kingdom
Posts: 1,937 Andrew User rank is Private First Class (20 - 50 Reputation Level)Andrew User rank is Private First Class (20 - 50 Reputation Level)  Folding Points: 2429 Folding Title: Novice Folder
Time spent in forums: 4 Days 1 h 57 m 37 sec
Reputation Power: 3
Orkut
RE: Another Way?

Forgot to say my command is

WGET /public_html/email.php

i presume it works because i get an email about my user every day.

Reply With Quote
  #3  
Old February 15th, 2004, 11:55 PM
honcho's Avatar
honcho honcho is offline
Contributing User
Codewalkers Beginner (1000 - 1499 posts)
 
Join Date: Apr 2007
Location: Cape Cod
Posts: 1,347 honcho User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 52 m 2 sec
Reputation Power: 3
RE: Another Way?

Why use wget at all? Why don't you just run the script via the php command line:

php -f /public_html/email.php

Reply With Quote
  #4  
Old February 16th, 2004, 07:58 AM
Andrew's Avatar
Andrew Andrew is offline
Moderator
Click here for more information
 
Join Date: Apr 2007
Location: United Kingdom
Posts: 1,937 Andrew User rank is Private First Class (20 - 50 Reputation Level)Andrew User rank is Private First Class (20 - 50 Reputation Level)  Folding Points: 2429 Folding Title: Novice Folder
Time spent in forums: 4 Days 1 h 57 m 37 sec
Reputation Power: 3
Orkut
RE: Another Way?

ok thanks.

Reply With Quote
  #5  
Old February 17th, 2004, 02:39 AM
tchala tchala is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Manchester, UK
Posts: 59 tchala User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
RE: Another Way?

The problem with calling PHP directly (above) is that in many cases you only have the module installed, not the executable

I _always_ use cURL - the method below works flawlessly

Most servers have cURL installed (if not go get it from http://www.haxx.se)

cURL is a command-line based tool similar to wget but with many more options and facilities

Then add into your crontab something along the lines of

/usr/bin/curl http://www.myserver.dom/somecode.php

It's a good idea to have the line

MAILTO=''

somewhere above this in your cron or root will end up getting an email of the HTML

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesProgramming Theory > Another Way?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway