I run a cron job at 2am that shuts down Weewx, copies the database and restarts it. I used to then copy the backup copy to google drive, but google made the authentication impossible, so I stopped doing that part. I just manually copy it from time to time - perhaps I should do what you're doing with pscp too. Anyway, copying the copy would protect you from a conflict.
On Fri, Jun 21, 2024 at 1:48 PM Jeff Allison <[email protected]> wrote: > Hello, > > Just recently installed weewx and I'm looking for the best way to make > regular backups. My plan is to create a Windows batch file that uses pscp > to copy all the relevant files to a folder on my Windows system and > schedule that to run daily. Pretty straightforward, but I'm concerned about > getting a valid copy of the sqlite database file. The docs make this > warning: > > *For a SQLite configuration, do not make the copy of the database file > while in the middle of a transaction! Schedule the backup for immediately > after an archive record is written, and then make sure the backup completes > before the next archive record arrives. * > > I don't know how I can make sure the database is not in the middle of a > transaction when I'm attempting the copy. Shutting down and restarting > weewx I guess is possible using ssh commands in the batch file, but that's > getting more complicated. How worried do I need to be about getting a bad > backup file if I just copy the file over? > > Thanks! > > -- > 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 on the web visit > https://groups.google.com/d/msgid/weewx-user/a7ffec0e-81ac-453c-b113-1c497e36783dn%40googlegroups.com > <https://groups.google.com/d/msgid/weewx-user/a7ffec0e-81ac-453c-b113-1c497e36783dn%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- Peter Quinn (415)794-2264 -- 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 on the web visit https://groups.google.com/d/msgid/weewx-user/CAA1SM23PAijxqfVDLLjBrwEmzhwewaco2_PHxPdwGUBMUtq3uw%40mail.gmail.com.
