Run "cron command" from browser?

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
jmueller0823
Forum Commoner
Posts: 37
Joined: Tue Apr 20, 2004 9:06 pm

Run "cron command" from browser?

Post by jmueller0823 »

We have a cron that runs wget, something like this:

Code: Select all

/usr/local/bin/wget -N -q -P public_html http://www.site.com/stage/index.php
There are occasions when we need to quickly run this--
without going to Putty and running manually.

Is there a way to execute this from a browser? Thanks.
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Post by pickle »

You can run that command from a PHP file:

Code: Select all

<?PHP

$command = "/usr/local/bin/wget -N -q -P public_html http://www.site.com/stage/index.php";
shell_exec($command);

?>
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Post Reply