I actually think 'cp' is pretty safe. When WeeWX writes a record to the database, it has to update the main archive, as well as many daily summaries. To make sure this is all done atomicallly, it does it as one big transaction.
So, unless your 'cp' has the unfortunate timing of happening at the exact moment when the transaction is being committed, you should be fine. I don't know how big a time window that is. Maybe a couple hundred milliseconds? On Mon, Jan 11, 2021 at 5:01 PM vince <[email protected]> wrote: > For for 1,357,184 records in the db records in my 340 MB database's > archive table.... > Using Tom's variant from a local file to a backup file in the same working > directory.... > > Dockstar = 46.8 secs via python, 35.1 secs to cp (usb2 laptop > drive) > pi3 = 44.3 secs via python, 40.9 secs to cp (SD) > 2012 MacBook Air = 2.2 secs via python, 1.5 to cp it (SSD) > 2018 i3 NUC = 0.2 secs to do a cp (SSD) > > Looks to me like it's simpler to just copy the file using the 'cp' command > > > -- > 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/22c66dc0-46e0-4406-b610-57da6e38b1f2n%40googlegroups.com > <https://groups.google.com/d/msgid/weewx-user/22c66dc0-46e0-4406-b610-57da6e38b1f2n%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- 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/CAPq0zEC-cVFgsE8b986WJobXT9%3DkwT2cx5HTtEHjeMXsFm_JbA%40mail.gmail.com.
