fd219f7f5dea94cb8d98e7bea19117e797368f21
[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 "$BACKLOGDB" ".backup $BACKUP_DIR/$BACKLOG_BASE" 
10 fi
11
12 if [ ! -z "$LOGDB" ]; then
13         LOG_BASE=$(basename "$LOGDB")
14         sqlite3 "$LOGDB" ".backup $BACKUP_DIR/$LOG_BASE" 
15 fi