DB "canary" added - with fail/restart when connection dropped
[weathermon.git] / bin / weather-backup
1 #!/bin/sh
2
3 BACKUP_DIR=`uci get weathermon.process.backup_dir`
4 BACKLOGDB=`uci get weathermon.process.backlogdb` 
5 LOGDB=`uci get weathermon.process.logdb` 
6
7 if [ ! -z "$BACKLOGDB" ]; then
8         BACKLOG_BASE=$(basename "$BACKLOGDB")
9         sqlite3 -readonly "$BACKLOGDB" ".backup $BACKUP_DIR/$BACKLOG_BASE" 
10 fi
11
12 if [ ! -z "$LOGDB" ]; then
13         LOG_BASE=$(basename "$LOGDB")
14         sqlite3 -readonly "$LOGDB" ".backup $BACKUP_DIR/$LOG_BASE" 
15 fi