#1421 - Fix Backup retention

Fix #1421
This commit is contained in:
Made I.T 2018-01-02 21:05:31 +01:00 committed by GitHub
commit 9059167db7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -499,7 +499,7 @@ local_backup(){
backup_list=$(ls -lrt $BACKUP/ |awk '{print $9}' |grep "^$user\." | grep ".tar")
backups_count=$(echo "$backup_list" |wc -l)
if [ "$BACKUPS" -le "$backups_count" ]; then
backups_rm_number=$((backups_count - BACKUPS))
backups_rm_number=$((backups_count - BACKUPS + 1))
# Removing old backup
for backup in $(echo "$backup_list" |head -n $backups_rm_number); do