summaryrefslogtreecommitdiffstats
path: root/abs/core/LinHES-system/checkXFSfrag.sh
diff options
context:
space:
mode:
Diffstat (limited to 'abs/core/LinHES-system/checkXFSfrag.sh')
-rwxr-xr-xabs/core/LinHES-system/checkXFSfrag.sh10
1 files changed, 10 insertions, 0 deletions
diff --git a/abs/core/LinHES-system/checkXFSfrag.sh b/abs/core/LinHES-system/checkXFSfrag.sh
index 5fccece..d25eaa8 100755
--- a/abs/core/LinHES-system/checkXFSfrag.sh
+++ b/abs/core/LinHES-system/checkXFSfrag.sh
@@ -31,12 +31,22 @@ e='/usr/bin/echo -e' # Use the echo command, not
xfsfsr=/usr/bin/xfs_fsr # Set variable with the path to xfs_fsr.
xfsdb=/usr/bin/xfs_db # Set variable with the path to xfs_db.
ionice=/usr/bin/ionice # Set variable with the path to ionice.
+idle='/usr/LH/bin/idle.py -s' # Set varialbe with path to idle.py.
pctmax=12 # Set maxiumum frag percent needed for defrag.
# This is zero here for testing purposes only
# a higher number should be used in production.
array=`df -T|grep xfs|cut -f 1 --delim=" "` # Array of all XFS file systems.
for i in ${array[@]};
do
+ #check for idle flag
+ if [[ $1 == "--idle" ]]
+ then
+ while ! $idle
+ do
+ echo "System is busy. Waiting 10 minutes before trying again."
+ sleep 600
+ done
+ fi
#check that the device is SATA and skip defrag on SSDs
device=`echo ${i} | cut -f 3 --delim="/" | sed 's/[0-9]//g'`
isSATA=`cat /sys/block/${device}/queue/rotational`