Sandaysoft

Support forum for Cumulus weather station software
It is currently Wed Jun 19, 2013 9:25 am
Please click here before posting. Help me to help you!
Useful Links: Cumulus FAQ • Enhancement requests • Wiki (documentation)
Please put your approximate location into your profile
Add your web site to the Cumulus user map
Vantage Pro2 users with firmware 3.00 should upgrade to fw 3.12 and Cumulus 1.9.4

All times are UTC




Post new topic Reply to topic  [ 253 posts ]  Go to page Previous  1 ... 13, 14, 15, 16, 17
Author Message
 Post subject: Re: Cumulus Server Sided JpGraph Graphs
PostPosted: Mon Apr 09, 2012 6:10 pm 
Offline

Joined: Thu Mar 08, 2012 2:31 am
Posts: 14
Location: Little River, SC.
Weather Station: WH-1090
Operating System: vista
Quote:
I have thus created a PHP script ('realtime_log_prune.php') that is run once a day, a bit after midnight. The script first create a backup copy of the just ended day log file (I use the year-month-date convention in naming that backup file, such as 'realtime_log_2011-05-29.log' for yesterday's file); then, the script prunes all but the last 14 days (an option in the script) of weather data and create a new file; once the new file has been properly created, the old (from the previous day) 'realtime.log' file is deleted and the newly created (pruned) file is renamed 'realtime.log'. Before exiting, the script also deletes all but the 7 last backup files (also an option in the script) - therefore, my disk drive is left with one new (pruned) 'realtime.log' file and 7 'realtime_log_YYYY-MM-DD.log' backup files. With 14 days of weather data, the 'realtime.log' file usually maintains its size at 5,685 MB. That PHP script ('realtime_log_prune.php') should also be uploaded to the server and run once-a-day using a CRON job.


Hi Ray,
Can you post a zipped copy of your realtime_log_prune.php? I have been manually "pruning". this would be great.

Thanks!
Mike

_________________
Image


Top
 Profile  
 
 Post subject: Re: Cumulus Server Sided JpGraph Graphs
PostPosted: Sun May 20, 2012 6:40 am 
Offline
User avatar

Joined: Wed Sep 17, 2008 1:34 pm
Posts: 629
Location: Mesa, AZ USA
Weather Station: Davis VP2 Plus w/24 FARS
Operating System: WinX Pro SP3 Dedicated wstn
W2SWR wrote:
Hi Ray,
Can you post a zipped copy of your realtime_log_prune.php? I have been manually "pruning". this would be great.

Thanks!
Mike

Not sure what Ray's script looks like...

I use a script (rotate_realtime_log.php) that I run via cron once a month on the 3rd day of the month (just before midnight)... I do it on the 3rd day so that I have at least 48hours worth of data in the logs as I have some charts that go back that far.

The script deals with more than 1 months worth of data. It saves all but the current month into archive files and then rewrites the current realtime.log with the current months data.

Even with several months of data in the file, it only takes seconds to complete its task, so it is quick enough to be done between updates of the realtime.log itself. Originally, I only ran it every couple months or so.

A sample output run with 5 months of data in the realtime.log file looks like:

Code:
Processing ../realtime.log
Current Month = 2012-05

Dates Found in Data File:
Found Date: 2012-01
Found Date: 2012-02
Found Date: 2012-03
Found Date: 2012-04
Found Date: 2012-05 - Current Month Will Keep

Writing Data...

Saving Archive ../oldlogs/realtime-2012-01.log
Saving Archive ../oldlogs/realtime-2012-02.log
Saving Archive ../oldlogs/realtime-2012-03.log
Saving Archive ../oldlogs/realtime-2012-04.log
Saving ../realtime.log with current month info


It's too late now to clean it up, but I will look into doing it tomorrow.

_________________
Kevin
Image
All you need is Time, Aptitude and Desire ... and you can build just about anything...
Cumulus User Maps


Top
 Profile  
 
 Post subject: Re: Cumulus Server Sided JpGraph Graphs
PostPosted: Mon May 21, 2012 1:37 am 
Offline
User avatar

Joined: Wed Sep 17, 2008 1:34 pm
Posts: 629
Location: Mesa, AZ USA
Weather Station: Davis VP2 Plus w/24 FARS
Operating System: WinX Pro SP3 Dedicated wstn
Posted the script at: viewtopic.php?f=14&t=7568&p=64061#p64061

The project page for it: http://cumulus.tnetweather.com/projects ... elogrotate

_________________
Kevin
Image
All you need is Time, Aptitude and Desire ... and you can build just about anything...
Cumulus User Maps


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 253 posts ]  Go to page Previous  1 ... 13, 14, 15, 16, 17

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group