Update run_daemon.sh
fixed daemon.log causing elkserver disk space to be full.
50MB is just an arbitrary number. Feel free to change it to whatever that is reasonable
#
LOGFILE="/var/log/redelk/daemon.log"
+# du default size listing is 1024B/1KB
+# 2 MB = 2048
+MAXLOGSIZE=$((1024*50))
# Check if there isn't an old process running, we dont want to run this in parallel
pgrep daemon.py > /dev/null
DAEMON_RUNNING=$?
if [ $DAEMON_RUNNING -eq 1 ]; then
cd /usr/share/redelk/bin
+
+ CURRENTLOGSIZE=$(/usr/bin/du $LOGFILE | /usr/bin/cut -f1)
+ if [ $CURRENTLOGSIZE -gt $MAXLOGSIZE ];then
+ /usr/share/redelk/bin/daemon.py > $LOGFILE 2>&1
+ else
/usr/share/redelk/bin/daemon.py >> $LOGFILE 2>&1
+ fi
printf "`date +'%b %e %R'` Daemon script ran \n" >> $LOGFILE 2>&1
fi
