The program can be simplified even more:

import sqlite3

with sqlite3.connect('/home/weewx/archive/weewx.sdb') as original:
    with sqlite3.connect('/home/weewx/archive/weewx.sdb.backup') as backup:
        original.backup(backup, pages=10)

I'm finding that the time it takes to do the backup depends on whether the
backup file already exists. it's much faster if it does not, which makes me
think that it's actually doing an incremental backup. I don't see any
advantage to that.



On Mon, Jan 11, 2021 at 3:46 PM Graham Eddy <[email protected]> wrote:

> as a once-off i did nothing fancy, even hard-coding the number of pages
> and filename of database (trivial to fiddle), using shell time to measure
> elapsed time
>
> import sqlite3
>
> con = sqlite3.connect('/opt/weewx-4.2.0-test/archive/weewx.sdb')
> bck = sqlite3.connect('backup.db')
> with bck:
>     con.backup(bck, pages=1)
> bck.close()
> con.close()
>
>
>
> On 12 Jan 2021, at 4:24 am, vince <[email protected]> wrote:
>
> On Monday, January 11, 2021 at 5:03:14 AM UTC-8 [email protected] wrote:
>
>> conclusion: only seriously under-powered boxes would be unable to
>> complete within typical 300 sec archive interval.
>> would be good if someone with such a box gave it a try
>>
>>
> If you can point us at the exact script you used, I can run it versus a
> test db on a litany of seriousy under-powered boxes :-)
>
> I have everything from a Seagate Dockstar (128MB RAM, laptop drive, always
> on the edge of swapping) to pi using SD (model-B, zero, zeroW, pi3, pi3+,
> pi4)
>
>
> --
> 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/1EBCD01F-B1C8-48AC-8D5A-DFAF8B0E20D5%40gmail.com
> <https://groups.google.com/d/msgid/weewx-user/1EBCD01F-B1C8-48AC-8D5A-DFAF8B0E20D5%40gmail.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/CAPq0zEDNB7O5_%2B8qjBH%3DqhT1mdq5gs9v-xSKBf0foBCzLm%3DV5w%40mail.gmail.com.

Reply via email to