X-Git-Url: https://git.rvb.name/weathermon.git/blobdiff_plain/e32107a7fe79ce34f3bdf860410a6d5455efdca7..5f23c8a7c56799750221a9c2d8e904e154f8c515:/bin/dump-yesterday?ds=sidebyside diff --git a/bin/dump-yesterday b/bin/dump-yesterday index 457792f..d96d3dd 100755 --- a/bin/dump-yesterday +++ b/bin/dump-yesterday @@ -4,10 +4,14 @@ yesterday=`echo "print(os.date(\"%Y-%m-%d\",os.time()-24*60*60))" | /usr/bin/lua logdb=`uci get weathermon.process.logdb` -dumpdir=`uci get weathermon.process.archive_dir`/`echo "print(os.date(\"%Y/%m/%d\",os.time()-22*60*60))" | /usr/bin/lua` +if [ -f "$logdb" ]; then -mkdir -p $dumpdir + dumpdir=`uci get weathermon.process.archive_dir`/`echo "print(os.date(\"%Y/%m/%d\",os.time()-22*60*60))" | /usr/bin/lua` -/usr/bin/weather-filter $logdb dump-compacted $yesterday $dumpdir + mkdir -p $dumpdir -sqlite3 $logdb "delete from log where time_stamp