Welcome to the Cumulus Support forum.

Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024

Cumulus MX V4 beta test release 4.0.0 (build 4018) - 28 March 2024

Legacy Cumulus 1 release v1.9.4 (build 1099) - 28 November 2014 (a patch is available for 1.9.4 build 1099 that extends the date range of drop-down menus to 2030)

Download the Software (Cumulus MX / Cumulus 1 and other related items) from the Wiki

Realtime older then 7 days

From build 3044 the development baton passed to Mark Crossley. Mark has been responsible for all the Builds since. He has made the code available on GitHub. It is Mark's hope that others will join in this development, but at the very least he welcomes your ideas for future developments (see Cumulus MX Development suggestions).

Moderator: mcrossley

Post Reply
User avatar
dazza1223
Posts: 860
Joined: Sun 25 Jan 2015 8:41 pm
Weather Station: Davis Vantage Pro 2 plus
Operating System: Raspberry pi 4 (4gb)
Location: Worthing
Contact:

Realtime older then 7 days

Post by dazza1223 »

hi all right a long shot here i need bash script to remove Realtime older then 7 days as the Realtime keep building up and up ive look on the net for a script to do it but i cant fine one any where so plz can some one help me here plz :)
Have fun and keep learning

dazza :D

https://www.davisworthing.co.uk

Image
freddie
Posts: 2434
Joined: Wed 08 Jun 2011 11:19 am
Weather Station: Davis Vantage Pro 2 + Ecowitt
Operating System: GNU/Linux Ubuntu 22.04 LXC
Location: Alcaston, Shropshire, UK
Contact:

Re: Realtime older then 7 days

Post by freddie »

dazza1223 wrote: Mon 14 Jan 2019 3:01 pm hi all right a long shot here i need bash script to remove Realtime older then 7 days as the Realtime keep building up and up ive look on the net for a script to do it but i cant fine one any where so plz can some one help me here plz :)
Can you elaborate? What is Realtime? Where does it keep building up?
Freddie
Image
User avatar
dazza1223
Posts: 860
Joined: Sun 25 Jan 2015 8:41 pm
Weather Station: Davis Vantage Pro 2 plus
Operating System: Raspberry pi 4 (4gb)
Location: Worthing
Contact:

Re: Realtime older then 7 days

Post by dazza1223 »

sorry freddie yh Realtime is my Realtime database i only want to keep the past 7 day off the database and as mark has said there ins so much data in the Realtime database that why the the charts are slow
Have fun and keep learning

dazza :D

https://www.davisworthing.co.uk

Image
freddie
Posts: 2434
Joined: Wed 08 Jun 2011 11:19 am
Weather Station: Davis Vantage Pro 2 + Ecowitt
Operating System: GNU/Linux Ubuntu 22.04 LXC
Location: Alcaston, Shropshire, UK
Contact:

Re: Realtime older then 7 days

Post by freddie »

dazza1223 wrote: Mon 14 Jan 2019 5:11 pm sorry freddie yh Realtime is my Realtime database i only want to keep the past 7 day off the database and as mark has said there ins so much data in the Realtime database that why the the charts are slow
You could try this:

Code: Select all

DELETE FROM Realtime WHERE Realtime.DateCol < DATE_SUB(NOW(), INTERVAL 7 DAY);
Obviously check the table name and column name first :-)
That's syntax for Mysql - not sure what db you are running...
Freddie
Image
User avatar
dazza1223
Posts: 860
Joined: Sun 25 Jan 2015 8:41 pm
Weather Station: Davis Vantage Pro 2 plus
Operating System: Raspberry pi 4 (4gb)
Location: Worthing
Contact:

Re: Realtime older then 7 days

Post by dazza1223 »

:D :D thanks so is there a way to put that in a bash script my database is called ( cumulus) and the Table called ( Realtime )
Have fun and keep learning

dazza :D

https://www.davisworthing.co.uk

Image
freddie
Posts: 2434
Joined: Wed 08 Jun 2011 11:19 am
Weather Station: Davis Vantage Pro 2 + Ecowitt
Operating System: GNU/Linux Ubuntu 22.04 LXC
Location: Alcaston, Shropshire, UK
Contact:

Re: Realtime older then 7 days

Post by freddie »

dazza1223 wrote: Mon 14 Jan 2019 5:58 pm :D :D thanks so is there a way to put that in a bash script my database is called ( cumulus) and the Table called ( Realtime )

Code: Select all

#!/bin/bash
mysql -u cumulus -pPASSWORD -h localhost -e "DELETE FROM Realtime WHERE Realtime.DateCol < DATE_SUB(NOW(), INTERVAL 7 DAY);"
Check the path to bash on the first line.
Change PASSWORD for your password - note there is no space between the "-p" and your actual password.
Change localhost if you need to.
Check the column name (the one in the example is made up)
Freddie
Image
freddie
Posts: 2434
Joined: Wed 08 Jun 2011 11:19 am
Weather Station: Davis Vantage Pro 2 + Ecowitt
Operating System: GNU/Linux Ubuntu 22.04 LXC
Location: Alcaston, Shropshire, UK
Contact:

Re: Realtime older then 7 days

Post by freddie »

You might need to check the username (after "-u" ) too.
Freddie
Image
User avatar
mcrossley
Posts: 12694
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Realtime older then 7 days

Post by mcrossley »

But if you are using MX to upload your realtime data it will automatically trim your data for you, just specify the retention period in the MySQL settings?
User avatar
dazza1223
Posts: 860
Joined: Sun 25 Jan 2015 8:41 pm
Weather Station: Davis Vantage Pro 2 plus
Operating System: Raspberry pi 4 (4gb)
Location: Worthing
Contact:

Re: Realtime older then 7 days

Post by dazza1223 »

freddie thank u so much for the help and the bash scrip u made :D

and mark i dint see that in the mysql settting but ive found it so THANK U SO MUCH FOR PONT ME TO THAT
Have fun and keep learning

dazza :D

https://www.davisworthing.co.uk

Image
Post Reply