Update influxdbsize.sh

This commit is contained in:
Mike Reeves
2020-11-11 11:17:18 -05:00
committed by GitHub
parent 711f5ab38f
commit a4d3e109e6

View File

@@ -1,5 +1,14 @@
#!/bin/bash #!/bin/bash
APP=influxsize
lf=/tmp/$APP-pidLockFile
# create empty lock file if none exists
cat /dev/null >> $lf
read lastPID < $lf
# if lastPID is not null and a process with that pid exists , exit
[ ! -z "$lastPID" -a -d /proc/$lastPID ] && exit
echo $$ > $lf
INFLUXSIZE=$(du -s -k /host/nsm/influxdb | awk {'print $1'}) INFLUXSIZE=$(du -s -k /host/nsm/influxdb | awk {'print $1'})
echo "influxsize kbytes=$INFLUXSIZE" echo "influxsize kbytes=$INFLUXSIZE"