Hi.. I need a way of tracking what time the server went down and the difference between when it went up.
I currently have countdown timers on my site, and if my server goes down it messes them up. I need the timers to stop while server is down.
The way I was thinking todo this.. is make a CRON that runs every minute and records the current time. Then once the server goes down the last time is recorded. Then once it comes back.. it minuses current time fron last cron time.. and gets the downtime amount.
The only problem is.. I have other cronjobs that cant run while this is running. I need some guidance on how to make this.
Basically I have to make a MYSQL Code like this for when it reboots.
UPDATE table SET spendTime=spendTime+INTERVAL (DOWNTIME AMOUNT HERE)
I currently have countdown timers on my site, and if my server goes down it messes them up. I need the timers to stop while server is down.
The way I was thinking todo this.. is make a CRON that runs every minute and records the current time. Then once the server goes down the last time is recorded. Then once it comes back.. it minuses current time fron last cron time.. and gets the downtime amount.
The only problem is.. I have other cronjobs that cant run while this is running. I need some guidance on how to make this.
Basically I have to make a MYSQL Code like this for when it reboots.
UPDATE table SET spendTime=spendTime+INTERVAL (DOWNTIME AMOUNT HERE)