Page 1 of 1

Delete a single days data?

Posted: Mon 16 Nov 2020 9:59 pm
by Feek
Hi,

I started Cumulus running late in the day last Thursday and so my "Low daily temp range" is currently showing just 0.5°C on that day with highest minimum and lowest maximum both being on the same day. I can't see that on a real day I'm ever going to get lower than that so I'd like to be able to remove that data.

I'm quite happy just to blitz the entire 12th November from the records.

I've tried going into Data logs / Dayfile, highlighting the 12th and hitting Delete, then confirming the delete but it doesn't actually disappear, even though it says success.

I'm using Cumulus MX 3.9.1 b on a Pi4.

Can anyone offer some advice please - Can I just edit /opt/CumulusMX/data/dayfile.txt and delete the first line which is for 12/11/2020 or is there more to it than that?

Thanks.

Re: Delete a single days data?

Posted: Tue 17 Nov 2020 9:52 am
by Feek
Alternatively, if I stop Cumulus and blitz the entire contents of /opt/CumulusMX/data and then restart Cumulus, will that safely completely erase all my history and start again from scratch?

Re: Delete a single days data?

Posted: Tue 17 Nov 2020 9:58 am
by freddie
Feek wrote:
Tue 17 Nov 2020 9:52 am
Alternatively, if I stop Cumulus and blitz the entire contents of /opt/CumulusMX/data and then restart Cumulus, will that safely completely erase all my history and start again from scratch?
You could do. It might be better (although a bit more longwinded) to do as you originally proposed and delete the entry from dayfile.txt. You would need to do this with Cumulus stopped. Also, you should edit the value next to "StartDate" in the [Station] section of Cumulus.ini to your new start date - also with Cumulus stopped. Finally, you may have to edit some of your records if any records were set on the day that you are removing. You do this via the admin interface, with Cumulus running, of course.

Re: Delete a single days data?

Posted: Tue 17 Nov 2020 11:33 am
by Feek
Thanks.

I have no problem losing a few days data in order to tidy things up.

One thing I've noticed, looking in Cumulus.ini - Even though I built this on the 12th November, the StartDate there is 31st October, is it worth changing that?

I was thinking to stop Cumulus running a few minutes before midnight, rename the data directory and create a new empty one (so I have a backup) and restart Cumulus at 00:01. That way I'll be starting first thing in the morning with a clean data set. I'm not sure what time the daily housekeeping tasks take place though so this may not update my records correctly until 24 hours later.

Re: Delete a single days data?

Posted: Tue 17 Nov 2020 11:36 am
by freddie
Sounds like a plan. I would change "StartDate" in Cumulus.ini to whatever the date will be when you decide to do the restart, as well.

Re: Delete a single days data?

Posted: Tue 17 Nov 2020 11:39 am
by mcrossley
Starting at 00:01 with an empty data folder will give you a full days data. Some of Daily type records will not be set until the day rolls over the following midnight (assuming you are using midnight roll over). Likewise daily graphs will be effectively empty until you have at least two days data.

Re: Delete a single days data?

Posted: Tue 17 Nov 2020 3:54 pm
by Feek
Thanks Mark.

I don't intend to be up at midnight, I'm going to stop the Cumulus service, edit Cumulus.ini with tomorrow as the start date and empty the data directory before I go to bed with a cron job set to reboot at 00:01 tomorrow morning. That should do the trick.

What could possibly go wrong? :D

Re: Delete a single days data?

Posted: Wed 18 Nov 2020 2:21 pm
by Feek
All looking good so far, thanks for the help.

/edit (19/11/2020) - Yes, I can confirm this is all good.