Skip to content

Commit 441679a

Browse files
authored
Better place for backup LA check
1 parent 14f64bc commit 441679a

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

func/main.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -941,6 +941,22 @@ format_aliases() {
941941

942942

943943
wait_for_backup_if_it_is_not_time_for_backup() {
944+
# Checking load average
945+
la=$(cat /proc/loadavg |cut -f 1 -d ' ' |cut -f 1 -d '.')
946+
# i=0
947+
while [ "$la" -ge "$BACKUP_LA_LIMIT" ]; do
948+
echo -e "$(date "+%F %T") Load Average $la"
949+
sleep 60
950+
# if [ "$i" -ge "15" ]; then
951+
# la_error="LoadAverage $la is above threshold"
952+
# echo "$la_error" |$SENDMAIL -s "$subj" $email $notify
953+
# sed -i "/ $user /d" $VESTA/data/queue/backup.pipe
954+
# check_result $E_LA "$la_error"
955+
# fi
956+
la=$(cat /proc/loadavg |cut -f 1 -d ' ' |cut -f 1 -d '.')
957+
# (( ++i))
958+
done
959+
944960
# block backup if current hour is after 6 AM
945961
WAIT_LOOP_ENTERED=0
946962
if pgrep -x "v-backup-users" > /dev/null

0 commit comments

Comments
 (0)