On Wednesday, October 24, 2018 at 5:51:02 PM UTC-7, Greg Troxel wrote: > > Is there any equivalent to fsck where a database can be checked for > errors? > > yes - there was a long discussion here a couple years ago about that with how to check your database for internal errors, but a google for "sqlite3 check database' will find a bunch of hits as well for how to do it.
> > Is this dump/restore guaranteed to work, with some sort of transaction > semantics? > For the data that it could dump successfully, I'd think yes as the unique key (timestamp) should ensure that only unique records are restored. That said, I'm not positive that the script posted above is quite smart enough to do the right thing completely hands-off. For example, what if you had 1,000,000 records hypothetically and it was corrupted in the middle of the file....what would the .dump actually dump ? Would a simple dump/restore just restore the 'good' records using the script as-is with no manual intervention ? I'm not 100% certain. And for weewx, you 'probably' just want to restore the archive table, clear your NOAA files out, and let weewx on the new/clean system rebuild the other summary tables and NOAA files anyway. My script for backing up is on github <https://github.com/vinceskahan/vds-weewx-backup-data> and has been in use for at least 4 years here. I've checked hundreds of backups and they've all verified ok so far, FWIW. Hope I never have to use it for really restoring a backup in a corrupted db scenario. -- 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]. For more options, visit https://groups.google.com/d/optout.
