Revision [306]

Last edited on 2007-03-16 12:42:10 by KlenwellAdmin
Additions:
note: I've encountered shared hosting environments where GET is not available
Deletions:
**note:** I've encountered shared hosting environments where GET is not available


Revision [305]

Edited on 2007-03-16 12:41:39 by KlenwellAdmin
Additions:
**note:** I've encountered shared hosting environments where GET is not available


Revision [269]

Edited on 2007-03-08 15:19:24 by KlenwellAdmin
Additions:
The examples below represent various ways to set up a cron job for a Php script in a cPanel shared hosting environment.
%%GET 'http://domain.com/script.php' > /dev/null%%
=====Note on GET Variables=====
If you want to include GET variables in your cron job (like me), put your url in single quotation marks. Otherwise, they will get cut off. An explanation can be found [[http://h5197.serverkompetenz.net:9080/abstracture_public/projects-en/cronnix/tips/ here]]:
GET variables get truncated, so you have to wrap the url in quotes to make it work... This is because the shell will try to expand the arguments to 'open' and ? happens to be a shell wildcard character.
Deletions:
%%GET http://domain.com/script.php > /dev/null%%


Revision [259]

Edited on 2007-03-04 16:52:28 by KlenwellAdmin
Additions:
note: this will not run the script as in a browser, which may lead to unexpected results. for instance, GET variables cannot be set in the url.


Revision [258]

Edited on 2007-03-04 14:58:49 by KlenwellAdmin
Additions:
=====Simple Test Script=====
Upload this script to your server and set up a cron job to run it as a simple test:
%%
<?php
// a simple script to test cron jobs
echo "<h1>Cron Test</h1>";
if ( $_GET['cron'] = 'cron' ) echo '<p>GET ?cron=cron recognized</p>';
?>
%%


Revision [257]

Edited on 2007-03-04 14:53:58 by KlenwellAdmin

No Differences

Revision [256]

Edited on 2007-03-04 14:53:44 by KlenwellAdmin
Additions:
%%php -q /usr/home/USERNAME/script.php%%
%%/usr/bin/php -q /usr/home/USERNAME/script.php%%
Deletions:
%%php -q /home/serverpath/script.php%%


Revision [255]

Edited on 2007-03-04 14:51:09 by KlenwellAdmin
Additions:
**wget**
%%wget -O /dev/null http://www.domain.com/script.php%%
%%lynx -dump 'http://www.domain.com/script.php'%%
**php**
%%php -q /home/serverpath/script.php%%
**GET**
%%GET http://domain.com/script.php > /dev/null%%
Deletions:
%%lynx -dump 'http://www.domain.com/'%%


Revision [254]

Edited on 2007-03-04 14:45:53 by KlenwellAdmin
Additions:
**lynx**
lynx is a text-based web browser commonly available on linux servers ([[http://en.wikipedia.org/wiki/Lynx_%28web_browser%29 wikipedia]])
Deletions:
**php**


Revision [253]

The oldest known version of this page was created on 2007-03-04 14:44:28 by KlenwellAdmin
Valid XHTML 1.0 TransitionalValid CSSWikkaWiki