Do not skip backup if LA is above threshold

This commit is contained in:
dpeca 2018-10-30 14:33:40 +01:00 committed by GitHub
commit 3d0e6dd26b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -56,18 +56,19 @@ email=$(grep CONTACT $VESTA/data/users/admin/user.conf |cut -f 2 -d \')
# Checking load average # Checking load average
la=$(cat /proc/loadavg |cut -f 1 -d ' ' |cut -f 1 -d '.') la=$(cat /proc/loadavg |cut -f 1 -d ' ' |cut -f 1 -d '.')
i=0 # i=0
while [ "$la" -ge "$BACKUP_LA_LIMIT" ]; do while [ "$la" -ge "$BACKUP_LA_LIMIT" ]; do
echo -e "$(date "+%F %T") Load Average $la" echo -e "$(date "+%F %T") Load Average $la"
sleep 60 sleep 60
if [ "$i" -ge "15" ]; then wait_for_backup_if_it_is_not_time_for_backup
la_error="LoadAverage $la is above threshold" # if [ "$i" -ge "15" ]; then
echo "$la_error" |$SENDMAIL -s "$subj" $email $notify # la_error="LoadAverage $la is above threshold"
sed -i "/ $user /d" $VESTA/data/queue/backup.pipe # echo "$la_error" |$SENDMAIL -s "$subj" $email $notify
check_result $E_LA "$la_error" # sed -i "/ $user /d" $VESTA/data/queue/backup.pipe
fi # check_result $E_LA "$la_error"
# fi
la=$(cat /proc/loadavg |cut -f 1 -d ' ' |cut -f 1 -d '.') la=$(cat /proc/loadavg |cut -f 1 -d ' ' |cut -f 1 -d '.')
(( ++i)) # (( ++i))
done done
if [ -z "$BACKUP_TEMP" ]; then if [ -z "$BACKUP_TEMP" ]; then