Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 11-11-2004, 04:53 AM   #1
Voodoo
♥ ♦ ♣ ♠
 
Voodoo's Avatar
 
Industry Role:
Join Date: Sep 2002
Posts: 10,592
crontabs executing PHP scripts...

5 * * * * wget --spider -q http://url_to_file.php
10 * * * * wget --spider -q http://url_to_file.php
* 1 * * * wget --spider -q http://url_to_file.php


Does this look about right if I'm running command line PHP?
__________________

"I'm selflessly supporting the common good, but only coincidentally looking out for No.1."
Voodoo is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 11-11-2004, 04:58 AM   #2
notjoe
Confirmed User
 
Industry Role:
Join Date: May 2002
Location: Toronto, Canada
Posts: 5,599
Quote:
Originally posted by Voodoo
5 * * * * wget --spider -q http://url_to_file.php
10 * * * * wget --spider -q http://url_to_file.php
* 1 * * * wget --spider -q http://url_to_file.php


Does this look about right if I'm running command line PHP?
That doesnt involve any PHP code at all...looks like you're spidering your URLs which end in a php script (makes no difference)

First line will run wget on the 5th minute of every hour. Second like will run on the 10th minute of every hour and the thrid will run every hour at the begining of the hour.

Hopefully this helps you out

PS: You may or may not need to put the full path to wget. You should be able to find the absolute path by running "which wget" without the quotes

Last edited by notjoe; 11-11-2004 at 04:59 AM..
notjoe is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 11-11-2004, 05:00 AM   #3
Napolean
Old school
 
Napolean's Avatar
 
Industry Role:
Join Date: Nov 2002
Location: Kettering, OH
Posts: 4,327
Quote:
Originally posted by notjoe
That doesnt involve any PHP code at all...looks like you're spidering your URLs which end in a php script (makes no difference)

First line will run wget on the 5th minute of every hour. Second like will run on the 10th minute of every hour and the thrid will run every hour at the begining of the hour.

Hopefully this helps you out

PS: You may or may not need to put the full path to wget. You should be able to find the absolute path by running "which wget" without the quotes
i think he was just looking for a yes or no, but rock on
__________________
Need a programmer? (Desktop/Web Applications) --- Skype: napoleande
Napolean is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 11-11-2004, 05:02 AM   #4
Voodoo
♥ ♦ ♣ ♠
 
Voodoo's Avatar
 
Industry Role:
Join Date: Sep 2002
Posts: 10,592
Quote:
Originally posted by notjoe
That doesnt involve any PHP code at all...looks like you're spidering your URLs which end in a php script (makes no difference)

First line will run wget on the 5th minute of every hour. Second like will run on the 10th minute of every hour and the thrid will run every hour at the begining of the hour.

Hopefully this helps you out

PS: You may or may not need to put the full path to wget. You should be able to find the absolute path by running "which wget" without the quotes
So this will act as a "hit" on each of the URLs in said crontab, right? As if I were to open that page in a browser window.
__________________

"I'm selflessly supporting the common good, but only coincidentally looking out for No.1."
Voodoo is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 11-11-2004, 05:03 AM   #5
notjoe
Confirmed User
 
Industry Role:
Join Date: May 2002
Location: Toronto, Canada
Posts: 5,599
Quote:
Originally posted by Napolean
i think he was just looking for a yes or no, but rock on
I think he may be confused so i was just trying to clear things up He mentioned runing php from the command line yet in what he pasted there is no PHP program, just crontab code which doesnt attempt to run any php code
notjoe is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 11-11-2004, 05:05 AM   #6
Voodoo
♥ ♦ ♣ ♠
 
Voodoo's Avatar
 
Industry Role:
Join Date: Sep 2002
Posts: 10,592
Quote:
Originally posted by notjoe
I think he may be confused so i was just trying to clear things up He mentioned runing php from the command line yet in what he pasted there is no PHP program, just crontab code which doesnt attempt to run any php code
Running PHP Command Line Mode. Instead of in Apache mode.
__________________

"I'm selflessly supporting the common good, but only coincidentally looking out for No.1."
Voodoo is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 11-11-2004, 05:05 AM   #7
notjoe
Confirmed User
 
Industry Role:
Join Date: May 2002
Location: Toronto, Canada
Posts: 5,599
Quote:
Originally posted by Voodoo
So this will act as a "hit" on each of the URLs in said crontab, right? As if I were to open that page in a browser window.
Correct, although the hit will show up as having WGET as the browser (which you can spoof if needed).
notjoe is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 11-11-2004, 05:07 AM   #8
Voodoo
♥ ♦ ♣ ♠
 
Voodoo's Avatar
 
Industry Role:
Join Date: Sep 2002
Posts: 10,592
Quote:
Originally posted by notjoe
Correct, although the hit will show up as having WGET as the browser (which you can spoof if needed).
Ok, that answers my question. Spoofing not needed, I'm just trying to run a couple PHP scripts, via a crontab.

Thanks
__________________

"I'm selflessly supporting the common good, but only coincidentally looking out for No.1."
Voodoo is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 11-11-2004, 05:10 AM   #9
notjoe
Confirmed User
 
Industry Role:
Join Date: May 2002
Location: Toronto, Canada
Posts: 5,599
Quote:
Originally posted by Voodoo
Running PHP Command Line Mode. Instead of in Apache mode.
Running PHP from the command line - Executing the script via the shell terminal you're logged in to

Running PHP as a CGI - The webserver forks the process and executes the script (somewhat simular to the command line)

Running PHP as a module - APACHE internally processes the script instead of forking a process and using the php binary file to execute the script.
notjoe is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 11-11-2004, 05:11 AM   #10
notjoe
Confirmed User
 
Industry Role:
Join Date: May 2002
Location: Toronto, Canada
Posts: 5,599
Quote:
Originally posted by Voodoo
Ok, that answers my question. Spoofing not needed, I'm just trying to run a couple PHP scripts, via a crontab.

Thanks

Are the scripts located on the same server as the wget crontab?
notjoe is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 11-11-2004, 05:12 AM   #11
Voodoo
♥ ♦ ♣ ♠
 
Voodoo's Avatar
 
Industry Role:
Join Date: Sep 2002
Posts: 10,592
Quote:
Originally posted by notjoe
Are the scripts located on the same server as the wget crontab?
Yes
__________________

"I'm selflessly supporting the common good, but only coincidentally looking out for No.1."
Voodoo is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 11-11-2004, 05:16 AM   #12
notjoe
Confirmed User
 
Industry Role:
Join Date: May 2002
Location: Toronto, Canada
Posts: 5,599
Quote:
Originally posted by Voodoo
Yes
I "think" what you want to do is something like this then

Find the path to the PHP binary "which php" without quotes. Then change the lines to this

5 * * * * /usr/local/bin/php /path/to/php/script.php

But only if you only want to run that script... if you still want to use wget's spidering abilities then stick to the way you've done it

Last edited by notjoe; 11-11-2004 at 05:18 AM..
notjoe is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 11-11-2004, 05:21 AM   #13
Voodoo
♥ ♦ ♣ ♠
 
Voodoo's Avatar
 
Industry Role:
Join Date: Sep 2002
Posts: 10,592
Quote:
Originally posted by notjoe
I "think" what you want to do is something like this then

Find the path to the PHP binary "which php" without quotes. Then change the lines to this

5 * * * * /usr/local/bin/php /path/to/php/script.php

But only if you only want to run that script... if you still want to use wget's spidering abilities then stick to the way you've done it
OIC, so instead of using wget to run a PHP script, I can just point the crontab to the PHP module then the .php file and it will execute the script?
__________________

"I'm selflessly supporting the common good, but only coincidentally looking out for No.1."
Voodoo is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 11-11-2004, 05:27 AM   #14
notjoe
Confirmed User
 
Industry Role:
Join Date: May 2002
Location: Toronto, Canada
Posts: 5,599
Quote:
Originally posted by Voodoo
OIC, so instead of using wget to run a PHP script, I can just point the crontab to the PHP module then the .php file and it will execute the script?
Correct, as long as you have PHP installed as a binary (Command line/CGI install) then you can execute scripts against it without actually having to run them through the web server.

Hit me up on ICQ at 5956902 if you need anymore help

(assuming that by module you mean executable binary file which is the php parser/interrupter)

If php is installed as an APACHE module and not as a binary file then you wont be able to do it and will have to use wget/apache OR you could just install PHP as a binary file

Last edited by notjoe; 11-11-2004 at 05:29 AM..
notjoe is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.