X-Git-Url: https://git.rvb.name/weathermon.git/blobdiff_plain/7edb3771717d15f7c36d8459fa12b3d6f76d7d9a..e32107a7fe79ce34f3bdf860410a6d5455efdca7:/bin/weather-backup diff --git a/bin/weather-backup b/bin/weather-backup new file mode 100755 index 0000000..fd219f7 --- /dev/null +++ b/bin/weather-backup @@ -0,0 +1,15 @@ +#!/bin/sh + +BACKUP_DIR=`uci get weathermon.process.backup_dir` +BACKLOGDB=`uci get weathermon.process.backlogdb` +LOGDB=`uci get weathermon.process.logdb` + +if [ ! -z "$BACKLOGDB" ]; then + BACKLOG_BASE=$(basename "$BACKLOGDB") + sqlite3 "$BACKLOGDB" ".backup $BACKUP_DIR/$BACKLOG_BASE" +fi + +if [ ! -z "$LOGDB" ]; then + LOG_BASE=$(basename "$LOGDB") + sqlite3 "$LOGDB" ".backup $BACKUP_DIR/$LOG_BASE" +fi