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 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.

Reply via email to