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 4019) - 03 April 2024
Legacy Cumulus 1 release 1.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
Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024
Cumulus MX V4 beta test release 4.0.0 (build 4019) - 03 April 2024
Legacy Cumulus 1 release 1.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
Moderator: mcrossley
- 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
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
-
- Posts: 2473
- 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
Can you elaborate? What is Realtime? Where does it keep building up?
- 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
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
-
- Posts: 2473
- 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
You could try this:
Code: Select all
DELETE FROM Realtime WHERE Realtime.DateCol < DATE_SUB(NOW(), INTERVAL 7 DAY);
That's syntax for Mysql - not sure what db you are running...
- 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
thanks so is there a way to put that in a bash script my database is called ( cumulus) and the Table called ( Realtime )
-
- Posts: 2473
- 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
Code: Select all
#!/bin/bash
mysql -u cumulus -pPASSWORD -h localhost -e "DELETE FROM Realtime WHERE Realtime.DateCol < DATE_SUB(NOW(), INTERVAL 7 DAY);"
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)
- mcrossley
- Posts: 12756
- 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
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?
- 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
freddie thank u so much for the help and the bash scrip u made
and mark i dint see that in the mysql settting but ive found it so THANK U SO MUCH FOR PONT ME TO THAT
and mark i dint see that in the mysql settting but ive found it so THANK U SO MUCH FOR PONT ME TO THAT