mirror of
https://github.com/paulscherrerinstitute/sf_daq_buffer.git
synced 2026-05-11 23:05:35 +02:00
moved to ansible on sf_daq_broker/operation_tools
This commit is contained in:
committed by
Data Backend account
parent
7f246193df
commit
ad8578201f
@@ -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
|
||||
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user