LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   How do I automate saving a page on my site every day? (https://www.linuxquestions.org/questions/linux-general-1/how-do-i-automate-saving-a-page-on-my-site-every-day-328626/)

kiltannen 05-30-2005 03:54 PM

How do I automate saving a page on my site every day?
 
First off - I apologise if I haven't chosen the right forum to post this in - if it is in the wrong place could a MOD please shift it to where it needs to be...

I have a particular PHP script on my site which is VERY CPU intensive - I would like to save a copy of this file to html once or twice a day. With the plan of pointing my users to that rather than the CPU intensive php...

I am very comfortable doing the cron bit's in a job like this - BUT I just don't really know where to start on the webserver bit.

I am hoping somebody has done something like this before - and that it would be fairly straitforward.

I run:
Red-Hat server OS
Apache web-server
php
MySQL
All on a dedicated server...


If more specifics are needed - no problem - but I don't think what I want to do is very version dependant.

BTW - the script takes a bit more than 120secs to run - and while it is running my server pretty much grinds to a halt. modifying the script to be less intensive is pretty much not possible - it needs the large amount of data it is manipulating and the problem is only likely to get worse - not better.

The script is a page in the phpBB forum software - so I really need to essentially call it in a "browser" if possible. The language for the script is php.

I have made a custom portion on this page which displays contribution statistics from my database - in essence the php script performs an SQL query - then intialises a bunch of variables with the result set - hands those variables of to the templating engine of the phpBB software - and serves it up to the browser.

I want to take a "snapshot" twice a day - and serve up a static page...

Hopefully somebody can give me some suggestions. I did do a quick search but didn't manage to come up with anything that I could figure out how to apply...

trickykid 05-30-2005 04:28 PM

First of all.. what is this script in phpbb? Is it the backup your forum script? If so, why not just use mysqldump or any other tool that actually resides on your server to perform backups. Unless this is just a regular page that doesn't require any intervention.. use wget to retrieve the page.

kiltannen 05-30-2005 09:12 PM

Re: How do I automate saving a page on my site every day?
 
Quote:

Originally posted by kiltannen I have made a custom portion on this page which displays contribution statistics from my database - in essence the php script performs an SQL query - then intialises a bunch of variables with the result set - hands those variables of to the templating engine of the phpBB software - and serves it up to the browser.
This custom script is NOT to do a backup - I already do a mySQLDump through CRON 4 times a day for that important function...

trickykid - You ROCK!

This utility is EXACTLY what I wanted!.

THANK YOU.

The power of community - you have truly answered my need...


All times are GMT -5. The time now is 02:59 AM.