Hi Stefano

I'll share my solution in the hope that it can help you.  I wanted to 
backup both my weewx configuration and the data in the event I need to 
recover from a failure.  I have a NAS (QNAP brand) that is my backup 
location.  Here's what I did.


   1. Create a share on the NAS for weewx.
   2. Create a user that is allowed to read and write to the weewx NAS 
   share.
   3. I created a directory on the weewx machine to mount the NAS share - I 
   used /mnt/NAShostname
   4. On my weewx machine I edited /etc/fstab to mount the NAS share to the 
   weewx machine.  If you look around there are good guides to help with fstab 
   entries.
   5. I experimented with manual commands to synchronise the folders that 
   need to be backed up to the folder where the NAS share is mounted.  In my 
   case i used rsync.
   6. Once I was confident I created a script to shutdown weewx, run the 
   backup commands and restart weewx.
   7. The script needs to be made executable chmod +x scriptfilename
   8. I then copied the script to the cron.daily directory so it executes 
   each day.

I hope this helps gets you on the right track.  I'm also not at all 
comfortable with the linux command line.  Each step required a lot of 
searching to find examples of what I needed to do.

The following is what my backup script looks like



#!/bin/bash



# A script to backup weewx configuration files to NAShostname (and SQLite 
data until MySQL service can be restored)



# While SQLite is being used, the service needs to be stopped before 
copying the data file to avoid corruption if the system is writing to the 
file during copy.

/etc/init.d/weewx stop

sleep 5



# Perform backup

rsync -r        /etc/weewx              /mnt/NAShostname/etc

rsync -r        /usr/share/weewx/user   /mnt/NAShostname/usr/share/weewx

rsync -r        /var/lib/weewx          /mnt/NAShostname/var/lib

rsync -r        /home/weewx/scripts     /mnt/NAShostname/home/weewx



# Brinf weewx service backup.

/etc/init.d/weewx start



On Sunday, July 23, 2017 at 12:49:43 AM UTC+10, Stefano Rossi wrote:
>
>
>> It might still be *possible* that the database can be recovered. I doubt 
>> that Windows could make sense of a card formatted for Jessie.
>>
>> Are you able to boot a PC from a "live" desktop linux distro?
>>
>> Ideally that will be a PC you can dedicate to that task for a couple of 
>> days. I (and probably others) can help you probe the card for your data. 
>> However I expect that might require several back-and-forth postings. It 
>> would be handy if you didn't need to reboot the PC every time.
>>
>> Cameron
>>
>
> Unfortunately the card is really dead, I even can't format it... This is a 
> lesson for the further time... 
>

-- 
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].
For more options, visit https://groups.google.com/d/optout.

Reply via email to