Aggiunto compressione file di log dei driver
This commit is contained in:
@@ -1,3 +1,6 @@
|
||||
# 0.5.12.1 - 23/06/2019
|
||||
- Added zip log drver file when exceeding the size limit
|
||||
|
||||
# 0.5.12 - 13/11/2018
|
||||
- Fixed a bug that prevented the publication of the mqtt topic for each event
|
||||
- Fixed a bug on openweathermap driver which in some cases causes a malformation of the json status and prevented communication with piGardenWeb
|
||||
|
||||
@@ -299,6 +299,14 @@ function log_write {
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -e "$LOG_OUTPUT_DRV_FILE" ]; then
|
||||
local actualsize=$($WC -c <"$LOG_OUTPUT_DRV_FILE")
|
||||
if [ $actualsize -ge $LOG_FILE_MAX_SIZE ]; then
|
||||
$GZIP $LOG_OUTPUT_DRV_FILE
|
||||
$MV $LOG_OUTPUT_DRV_FILE.gz $LOG_OUTPUT_DRV_FILE.`date +%Y%m%d%H%M`.gz
|
||||
fi
|
||||
fi
|
||||
|
||||
echo -e "`date`\t\t$1" >> $LOG_FILE
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user