mountainhazelnuts / Met-station

Met-station setup, install and usage guide
0 stars 0 forks source link

Make daily backup of metdata to USB drive #2

Open peterdcrees opened 6 years ago

peterdcrees commented 6 years ago

The weewx service saves the met-station data into its own SQLite database.

We want a daily backup of this data to be saved onto an attached USB drive in csv format so that field staff can simply replace the USB drive to 'download' data from eh station.

To dump SQLite as csv: sqlite3 /var/lib/weewx/weewx.sdb .headers on .mode csv .output filename.csv select * from archive; exit

This should be run as a cron job at 00:10 each day to backup the previous days data. Then copy the generated file to the mounted USB drive.

peterdcrees commented 6 years ago

@swangchuck Please run and test the csv export, it may require the weewx service to be stopped then restarted after the data dump.