I've put together an extension for weeWX that performs a database backup and I'll quickly add that, it shouldn't interfere with weewx's core function; not with its default config anyway.
It's available at https://github.com/glennmckechnie/weewx-sqlbackup As pre-configured it will take a daily back up, of a 24 hour time period, of the default database. There are options within skin.conf to expand that to longer periods, multiple databases, multiple (sqlbackup) skins; if you're very careful! It's all described on the skins github wiki, with the most current version available in the skins directory as sqlbackupREADME.html. It's predominately system shell wrapped in python. I've attempted to integrate it with weewx as best I can, or understand weewx, and python. If there's any glaring mistakes then let me know, if for no other reason than to stop them polluting the weeWX-sphere. Heck trivial mistakes are worth a heads up too. It was done as a skin (rather than a cron, shell script combo) for a few reasons. The main one being that I wanted a solution that was linked directly to weewx, one that could travel with it so that I didn't have to remember what I'd done and where I'd put it. Another is that running as a skin means that it can be configured on the fly and with the available options it offers pretty good flexibility. Under weewx's control, it can then be run during the report - non-write and hopefully non-read - cycle of weewx. I'm mindful of one of Tom's comments regarding weewx losing it's wee'ness, and something to the affect that backups are best left to a means other than weewx. Hmmm. Ooops, What can I say in my defence? I had an itch? It's an optional skin. The notes are (over)loaded with warnings. And it does work, particularly for my setup where I take small backups, often. I always appreciate others openness and work, hopefully this fits the 'payment in kind' philosophy. If that doesn't convince, then I just plead forgiveness. :-) Apologies in advance if it causes some user to report weewx as faulty, when it has instead been this that has dragged it down. Although if you have a decent processor and a long archive interval, you probably won't notice any buckling of its proverbial knees. I have tested it, and used it - just the other day in fact (a Debian stretch upgrade that went south). As dogfood, it passed the test. A live version is at http://203.213.243.61/weewx/sqlbackup/ integrated (sort of) into the skin that's running there - newskin aka Seasons. That version is a demo with full debug turned on, multiple database, multiple skins and an overly zealous backup interval. It might even show an error or two if I'm testing it. Either way it's a preview and hopefully the NBN wireless service here is up to par so that it remains available. Cheers Glenn rorpi - read only raspberry pi + weewx: now with scripts <https://github.com/glennmckechnie/rorpi-raspberrypi> -- 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.
