From ad8578201f46733a9d8a7ed821b92f874f99a89a Mon Sep 17 00:00:00 2001 From: Dmitry Ozerov Date: Fri, 16 Jul 2021 14:32:21 +0200 Subject: [PATCH] moved to ansible on sf_daq_broker/operation_tools --- scripts/clean_buffer.cron | 3 --- scripts/delete_old_files_in_buffer.sh | 30 --------------------------- 2 files changed, 33 deletions(-) delete mode 100644 scripts/clean_buffer.cron delete mode 100755 scripts/delete_old_files_in_buffer.sh diff --git a/scripts/clean_buffer.cron b/scripts/clean_buffer.cron deleted file mode 100644 index b90262b..0000000 --- a/scripts/clean_buffer.cron +++ /dev/null @@ -1,3 +0,0 @@ -heck every hour if buffer is occupied for larger then 80% and remove all files older then 3 hours -10 * * * * root /home/dbe/git/sf_daq_buffer/scripts/delete_old_files_in_buffer.sh 80 5 - diff --git a/scripts/delete_old_files_in_buffer.sh b/scripts/delete_old_files_in_buffer.sh deleted file mode 100755 index e461708..0000000 --- a/scripts/delete_old_files_in_buffer.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/bash - -hours=5 -threshold=80 - -if [ $# -ge 1 ] -then - threshold=$1 -fi -if [ $# -eq 2 ] -then - hours=$2 -fi - -df -h | grep BUFFER > /dev/null -if [ $? != 0 ] -then - # BUFFER is not present - exit -fi - -occupancy=`df -h /gpfs/photonics/swissfel/buffer | grep BUFFER | awk '{print $5}' | sed 's/%//'` -if [ ${occupancy} -lt ${threshold} ] -then -# echo OK, not action - exit -fi - -find /gpfs/photonics/swissfel/buffer/JF* -type f -mmin +$((${hours}*60)) -delete -find /gpfs/photonics/swissfel/buffer/JF*/M* -type d -mmin +$((${hours}*60)) -delete