We would need more information to diagnose. Can you post a session that shows this error? Use the command lsof to find what processes hold a file handle to the sqlite database. Something like this should do it:
*lsof | grep weewx* -tk On Tue, Dec 27, 2016 at 1:18 PM, Per Edström <peredstrom....@gmail.com> wrote: > I tried to run .backup in Sqlite3 but it says the DB is locked, even if I > stop Weewx. I can't find any solution to this.. > > On Sun, Dec 25, 2016 at 5:07 PM, Geoff Cusick <ge...@cusick.org.uk> wrote: > >> Been there, suffered the problem - 2 or 3 times! >> >> My solution is to create an image of your working system, stored on a >> drive attached to your PC. Set up a cron job on the weewx system to take a >> backup of the database (I use MySQL on the Raspberry Pi and use mysqldump) >> at least once in 24h. Recovery from SD card failure then comprises: >> 1 Write the saved image to a new SD card. This will also write an old >> database, but no matter. >> 2 Boot that image on the RPi. >> 3 Stop weewx. >> 4 Restore the database from the most recent backup (again, I use MySQL; I >> suspect sqlite is simpler) >> 5 Start weewx, and wait for it to update the database from the weather >> station. I use a Davis VantageVue, withthe Davis USB logger, which stores >> several days' worth of records. >> >> The procedure is a bit cumbersome, but it has worked for me! I keep 7 >> days of database backups on a NAS on my home network. >> >> Incidentally, I've done a few other things to reduce the number of writes >> to the SD card: I use a syslog alternative that uses a RAM buffer rather >> than writing to /var/log, and I've put the RPi's web server storage on a >> ramdisk. >> >> Hope that helps >> Geoff >> >> -- >> You received this message because you are subscribed to a topic in the >> Google Groups "weewx-user" group. >> To unsubscribe from this topic, visit https://groups.google.com/d/to >> pic/weewx-user/rPWzG0K6kDg/unsubscribe. >> To unsubscribe from this group and all its topics, send an email to >> weewx-user+unsubscr...@googlegroups.com. >> For more options, visit https://groups.google.com/d/optout. >> > > -- > 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 weewx-user+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- 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 weewx-user+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.