@vince, And this is precisely a constructive suggestion - a recommendation 
that I can use to check something. The result of this check is as follows:

stalker@e6540:~$ file weewx.sdb 
weewx.sdb: SQLite 3.x database, last written using SQLite version 3040001, 
file counter 205338, database pages 13895, cookie 0x236, schema 4, UTF-8, 
version-valid-for 205338

stalker@e6540:~$ echo "pragma integrity_check" | sqlite3 weewx.sdb
*** in database main ***
Tree 2 page 10667 cell 2: Rowid 1754505600 out of order
Fragmentation of 266 bytes reported as 0 on page 10667
NULL value in archive.usUnits
NULL value in archive.interval
row 132843 missing from index sqlite_autoindex_archive_1
database disk image is malformed

Now at least I know where to look. The question is whether (and if so, how) 
it can be fixed without creating the entire database.

Of course, there is still the option of creating a database from scratch 
using CSV files from the station panel, but that's a last resort. I would 
prefer to just fix the existing database, if possible.

PS. I also suspect the SD card in the RPi.

czwartek, 1 stycznia 2026 o 19:19:43 UTC+1 vince napisał(a):

> His suggestion was plenty constructive. If you don’t have a working backup 
> that means you don’t have a good enough backup solution. There were a 
> couple long threads here a while back about how to verify db and what a 
> good backup solution looks like.
>
> Verify your db looks like a db then verify it. 
>
> # file weewx.sdb
> weewx.sdb: SQLite 3.x database, last written using SQLite version 3026000
>
> # echo "pragma integrity_check" | sqlite3 weewx.sdb
> ok
>
> If it fails you might need to dump and restore the archive table year by 
> year until you determine where something wrong is located.
>
> Why did it happen ? Usually bad power to the pi or a failing SD card…
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/weewx-user/37ab63e9-2c24-4bb2-99b3-b13e4b322cc4n%40googlegroups.com.

Reply via email to