projects
/
weathermon.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Полностью новая версия веб-интерфейса на базе chart.js
[weathermon.git]
/
bin
/
dump-yesterday
diff --git
a/bin/dump-yesterday
b/bin/dump-yesterday
index 457792f9313498e90b2b2b240cfbe4ab52e93cba..d96d3dd6f5a0e3317982560f8b6f0d09d1547b43 100755
(executable)
--- 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`
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<date('now','-1 day')"
+ /usr/bin/weather-filter $logdb dump-compacted $yesterday $dumpdir
+
+ sqlite3 $logdb "delete from log where time_stamp<date('now','-1 day')"
+
+fi