From d32ad818773c9388ec3b341b0aa4492857293e56 Mon Sep 17 00:00:00 2001 From: cedricve Date: Sat, 23 May 2015 17:09:50 +0200 Subject: [PATCH] small fixes to run script --- 1.0.0/5_FAQ.md | 12 ++++++------ dev/5_FAQ.md | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/1.0.0/5_FAQ.md b/1.0.0/5_FAQ.md index 6db29432..f192e21b 100644 --- a/1.0.0/5_FAQ.md +++ b/1.0.0/5_FAQ.md @@ -244,11 +244,16 @@ Copy paste the bash script ################################################################ # Check if memory is more than 70%, if so refresh nodejs scripts ## - if [[ $(free | grep Mem | awk -F' ' '{ print $3/$2*100 }' | echo $0 ) > 70.0 ]]; + if [[ $(free | grep Mem | awk -F' ' '{ print $3/$2*100 }') > 70.0 ]]; then /usr/bin/forever restartall ; fi; + ############################################# + # Only keep images of last 3 days on sd-card. + ## + find /home/kerberos-web/public/capture/ -type f -name '*.jpg' -mtime +1 -exec rm {} \; + ############################################################## # Check if disk size is more than 95%, if so remove some files # from the capture directory. @@ -258,11 +263,6 @@ Copy paste the bash script rm -f $( ls -d -1tr /home/kerberos-web/public/capture/* | head -n 500); fi; - ############################################# - # Only keep images of last 3 days on sd-card. - ## - find /home/kerberos-web/public/capture/ -type f -name '*.jpg' -mtime +1 -exec rm {} \; - Give rights to bash script chmod +x /home/bash/run.sh diff --git a/dev/5_FAQ.md b/dev/5_FAQ.md index 6db29432..f192e21b 100644 --- a/dev/5_FAQ.md +++ b/dev/5_FAQ.md @@ -244,11 +244,16 @@ Copy paste the bash script ################################################################ # Check if memory is more than 70%, if so refresh nodejs scripts ## - if [[ $(free | grep Mem | awk -F' ' '{ print $3/$2*100 }' | echo $0 ) > 70.0 ]]; + if [[ $(free | grep Mem | awk -F' ' '{ print $3/$2*100 }') > 70.0 ]]; then /usr/bin/forever restartall ; fi; + ############################################# + # Only keep images of last 3 days on sd-card. + ## + find /home/kerberos-web/public/capture/ -type f -name '*.jpg' -mtime +1 -exec rm {} \; + ############################################################## # Check if disk size is more than 95%, if so remove some files # from the capture directory. @@ -258,11 +263,6 @@ Copy paste the bash script rm -f $( ls -d -1tr /home/kerberos-web/public/capture/* | head -n 500); fi; - ############################################# - # Only keep images of last 3 days on sd-card. - ## - find /home/kerberos-web/public/capture/ -type f -name '*.jpg' -mtime +1 -exec rm {} \; - Give rights to bash script chmod +x /home/bash/run.sh