Page 1 of 1

clear this doubt please...urgent

Posted: Tue Nov 14, 2006 1:25 am
by sweetraskels
hi ..
how to find the status of a website to know if the website is live or if the website has failed.

the site is a PHP site that runs against a MySQL database. Each day, a backup routine runs to store this content on tape. Once in a while, this backup routine seems to shut down the MySQL service, but not restart the service. So the page fails.


is there a way to run a script on a local workstation that checks once an hour (or every 30 minutes) the content of a site to see if is properly rendering. If there is a problem, the script should generate an email to the project leader responsible for that project.

is there a way to do this..?

if so please tell me

Posted: Tue Nov 14, 2006 8:01 am
by John Cartwright
simple.

Code: Select all

$file = @file_get_contents('http://php.net/');

if (!$file) {
   mail = mail(...);
}
To automate the process, consider searching for "cron tab", or "task scheduler"

Posted: Tue Nov 14, 2006 3:57 pm
by Ambush Commander
You could also set up a cron script on the MySQL server that ensures that the server is always up. You could also look at getting a less volatile backup procedure (hot backup, anyone?)

Posted: Tue Nov 14, 2006 5:12 pm
by Chris Corbyn
To see if it's "rendering" correctly you'd want to run some sort of diff. I've never had an issue with a bit of human involvement here. It's quite common for large companies (at least ones I used to support) to have a daily set of human checks to test various aspects of a website.

am new

Posted: Tue Nov 14, 2006 9:51 pm
by sweetraskels
hi..

thanks for your help..

but u know am new to this php

i cnt get what is cron script or smething of tat sort

can you explain me in detail as how to do

and where to do

Posted: Tue Nov 14, 2006 10:04 pm
by John Cartwright

urgent

Posted: Wed Nov 15, 2006 3:11 am
by sweetraskels
hi am using Windows 2003 server
and not linux
now wat to do

Posted: Wed Nov 15, 2006 2:14 pm
by feyd
google icron.

Posted: Thu Nov 16, 2006 8:35 am
by theFool
For windows server 2003 you can use the build-in task scheduler, too.

here is a small tutorial to start with:
http://www.iopus.com/guides/winscheduler.htm