From 5f161e3c9701d1d213499202f0f6755ed2de7066 Mon Sep 17 00:00:00 2001 From: Dmitry Ozerov Date: Tue, 27 Oct 2020 19:57:41 +0100 Subject: [PATCH] update to a cleanup scripts of buffer --- scripts/clean_buffer.cron | 3 +++ scripts/delete_old_files_in_buffer.sh | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 scripts/clean_buffer.cron diff --git a/scripts/clean_buffer.cron b/scripts/clean_buffer.cron new file mode 100644 index 0000000..b90262b --- /dev/null +++ b/scripts/clean_buffer.cron @@ -0,0 +1,3 @@ +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 index ddcfed1..e461708 100755 --- a/scripts/delete_old_files_in_buffer.sh +++ b/scripts/delete_old_files_in_buffer.sh @@ -3,11 +3,11 @@ hours=5 threshold=80 -if [ $# = 1 ] +if [ $# -ge 1 ] then threshold=$1 fi -if [ $# = 2 ] +if [ $# -eq 2 ] then hours=$2 fi