quick weewx backup command

202 views
Skip to first unread message

vince

unread,
Feb 7, 2022, 2:03:58 PM2/7/22
to weewx-user
Given everybody updating to the new 4.6.0 version, I thought I'd post a couple quick tar commands to back up your weewx setup.

# for a packaged install using the Debian example
tar zcvf /var/tmp/weewx-backup.tgz --exclude=.git* --exclude=__pycache__  /etc/weewx /usr/share/weewx /var/lib/weewx /var/www/html/weewx

# for a setup.py installation
tar zcvf /var/tmp/weewx-backup.tgz --exclude=.git* --exclude=__pycache__  /home/weewx

Notes:
  • You could choose to not back up your public_html tree but a restore and weewx restart might take a rather 'long' time to rebuild the NOAA files.  I found the public_html tree is pretty small so I just back it up too.
  • For my setup.py system here, I manually back up my databases weekly so I (usually) skip backing that up by adding --exclude=archive to the setup.py example above.
  • There's an old sysadmin saying that "if you haven't done a restore, you haven't done a backup".   As an old (former) sysadmin, I agree :-)
Hope this helps.

James Deaton

unread,
Feb 7, 2022, 5:19:53 PM2/7/22
to weewx...@googlegroups.com
This is great, thank you for sharing. I would just add that it's always good to make sure a backup resides elsewhere as well. I typically rsync/scp the backup tar file to another system I have as a backup destination but a great alternative is leveraging rclone (https://rclone.org) and placing the complete compessed tar file on something like Dropbox/Google Drive/OneDrive or whatever cloud service you're comfortable with. I am very new to WeeWX and considering I'm running it on a Pi with an SD card -- I wanted to make certain I account for the inevitable SD card failure.

--
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 on the web visit https://groups.google.com/d/msgid/weewx-user/43d8a255-bad9-44b5-aeda-04a6bce3e360n%40googlegroups.com.

Tom Hogland

unread,
Feb 8, 2022, 9:50:37 AM2/8/22
to weewx-user
Thanks for this - nice to be able to stash it elsewhere, and one of those things that "I should be doing but haven't gotten around to yet". I checked my NOAA folder, and it's only 1MB (and that's complete since 4/2003). No reason not to include it, especially since text will crunch down to almost nothing. The database is 315MB, but it takes about 10 seconds to read, and since my backup file is only 89MB at the end why not include it as well?

I also added it to the crontab as a shell script that runs just before midnight daily. Now I have automated backups :D 

Thanks again,
Tom
Reply all
Reply to author
Forward
0 new messages