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