91.7 °F

Hum: 35% Dew: 60.2 °F
Baro: 1007.89 hPa
Wind: W @ 0.0 mph
Rain: No Rain Today
Data Updated: 20:16
TNET Weather Station - Mesa, AZ USA
Home   Forecasts   Graphs   Radar   Trends   Webcams   Weather Links   Archives   PROJECTS & SCRIPTS   About Us
TNET Weather Based Projects and Scripts > Cumulus RealTimeLog Rotate Script

Cumulus RealTimeLog Rotate Script

This is designed to work with the realtime.log files that are generated by this project: Cumulus RealTimeLog Script. That project creates realtime.log files from the realtime.txt files uploaded to the server by Cumulus, but it doesn't ever trim the file.

This script does that. I took my existing script that rotates my realtime.log files and pulled it out of my system. All of my scripts use common config scripts to get names, places, files, folders, timezones, configs, colors and even common functions... So the result is not as tidy as the original script, but I really can't distribute the script with my configs in it.

Downloads

What it Does


You should like I do, only run this once a month since it will only generate the archive files if the current month is newer than data in the logfile. Personally, I run it from cron on the 4th day of the month after midnight. This ensures there is 48 hours worth of data that I use for charts, trends and things.

Permissions

If you are running this via CLI, you most likely don't need to deal with this. As your cron will most likely run as you and the files you have are owned by you.

If however, you use this via the web, the web server needs to be able to write to the files.

Specifically... Whatever you use for the archive directory most likely should have 0777 (rwxrwxrw) permissions (Note this is a directory, NOT a file). This will allow the webserver to write to new files in the directory.

The realtime.log needs to most likely need to be 0666 (rw-rw-rw-) permissions.

Settings

The following settings are used...

Timezone Setting

Your Timezone - Ref: http://php.net/manual/en/timezones.php
$SITE['timezone']       =    'America/Phoenix';

Location of your realtime.log

Location of your realtime.log file. If the script is in the same dir as the log this should be okay.
$SITE['realtime_log']  =    './realtime.log';

Location of your Archive directory.

Location of your archive data. If you don't have one, you will need to create it (See permissions above)
$SITE['archive_dir']   =    './archives/';

Secret Code to Prevent Unwanted Runs

The Secret Code... If you use the script via the WEB, you need to set this to a set of numbers. Letters don't work.
$SITE['codeval']       =    intval('SET_ME_PLEASE');

SAVE YOUR SELF A HEADACHE!

If you are trying this for the first time, PLEASE make sure you backup your realtime.log file yourself somewhere so that if it messes it up, you can recover from it. The script does make a backup, but if that file fails you may end up without any of your historical data in the realtime.log.

Backups are a smart thing to do.... Be smart!

Copyright © 2017 TNET Systems Inc. - All rights reserved. Weather Collection for this website is done via Cumulus 1.9.4 build #1093 and Weather Display
Boltwire Cumulus Plugin by TNET using Boltwire v3.4.16 Hosting by TNET
Protens Server - IP: 54.80.41.172 [ec2-54-80-41-172.compute-1.amazonaws.com] - Views #51