Database during backup

106 views
Skip to first unread message

Keimpe Bleeker

unread,
Feb 17, 2025, 12:34:47 PM2/17/25
to weewx-user
Hi all, once a week a script, executed by CRON, is making a backup of the essentials like config files and the weewx.sdb, once a month an image of the SD-card. Prior to these backups I'm stopping Weewx, in my point of view to protect the database. The 'small backup' takes some minutes, the image about half an hour.  I'm curious if it is necesarry to shut down Weewx. Anobody a suggestion?    

John Kline

unread,
Feb 17, 2025, 12:59:20 PM2/17/25
to weewx...@googlegroups.com, weewx-user
The weewx database is only written to once for each archive period (typically 5 minutes).  There is no need to stop weewx to back it up.  Simply take a sha1sum of weewx.sdb before you copy it and then take a sha1sum of the copy.  If the sha1s differ, the database changed and you’ll need to sleep and try again.

You can make sure you never get unlucky with the backup by being thoughtful when you run the backup.  For example, if your archive period is 5 minutes, don’t run the backup on a 5 minute boundary.  For example, run it at 2 minutes pat the hour.

On Feb 17, 2025, at 9:34 AM, Keimpe Bleeker <blee...@gmail.com> wrote:

Hi all, once a week a script, executed by CRON, is making a backup of the essentials like config files and the weewx.sdb, once a month an image of the SD-card. Prior to these backups I'm stopping Weewx, in my point of view to protect the database. The 'small backup' takes some minutes, the image about half an hour.  I'm curious if it is necesarry to shut down Weewx. Anobody a suggestion?    

--
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+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/weewx-user/c84a0352-0b36-4e93-a78b-5fee18989600n%40googlegroups.com.

p q

unread,
Feb 17, 2025, 1:00:26 PM2/17/25
to weewx...@googlegroups.com
It's not necessary to shut down weewx for the weekly backup. The database is the only thing being written to and if you're accessing it won't be written to. However, I do stop weewx for my daily backup just to be sure, but it doesn't take very long. I stop weewx just long enough to make a local copy of the db and then restart it before copying the copy off site.

I have no idea what happens when you make an image of a running SD card.

On Mon, Feb 17, 2025 at 9:34 AM Keimpe Bleeker <blee...@gmail.com> wrote:
Hi all, once a week a script, executed by CRON, is making a backup of the essentials like config files and the weewx.sdb, once a month an image of the SD-card. Prior to these backups I'm stopping Weewx, in my point of view to protect the database. The 'small backup' takes some minutes, the image about half an hour.  I'm curious if it is necesarry to shut down Weewx. Anobody a suggestion?    

--
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+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/weewx-user/c84a0352-0b36-4e93-a78b-5fee18989600n%40googlegroups.com.


--
Peter Quinn
(415)794-2264

vince

unread,
Feb 17, 2025, 2:07:21 PM2/17/25
to weewx-user
I copy the db to a different directory then compress the copy. Very safe and reliable.

Keimpe Bleeker

unread,
Feb 20, 2025, 7:29:14 AM2/20/25
to weewx...@googlegroups.com

Thanks for the responses and I learned again!
It seems good to me to make the weekly small backup with Weewx-live on Saturday 01h07min and to stop Weewx for the monthly image backup.

Regards, Keimpe

Op ma 17 feb 2025 om 20:07 schreef vince <vince...@gmail.com>:
You received this message because you are subscribed to a topic in the Google Groups "weewx-user" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/weewx-user/I2q3gPszItk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to weewx-user+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/weewx-user/328665b8-4799-4c74-83ce-ea37b01fda19n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages