mirror of
https://github.com/serghey-rodin/vesta.git
synced 2025-08-14 10:37:39 -07:00
Fix backup rotate for ftp/sftp mode
This commit is contained in:
parent
a217391565
commit
da5bcbe624
1 changed files with 2 additions and 2 deletions
|
@ -615,7 +615,7 @@ ftp_backup() {
|
|||
fi
|
||||
backups_count=$(echo "$backup_list" |wc -l)
|
||||
if [ "$backups_count" -ge "$BACKUPS" ]; then
|
||||
backups_rm_number=$((backups_count - BACKUPS))
|
||||
backups_rm_number=$((backups_count - BACKUPS + 1))
|
||||
for backup in $(echo "$backup_list" |head -n $backups_rm_number); do
|
||||
backup_date=$(echo $backup |sed -e "s/$user.//" -e "s/.tar$//")
|
||||
echo -e "$(date "+%F %T") Rotated ftp backup: $backup_date" |\
|
||||
|
@ -770,7 +770,7 @@ sftp_backup() {
|
|||
fi
|
||||
backups_count=$(echo "$backup_list" |wc -l)
|
||||
if [ "$backups_count" -ge "$BACKUPS" ]; then
|
||||
backups_rm_number=$((backups_count - BACKUPS))
|
||||
backups_rm_number=$((backups_count - BACKUPS + 1))
|
||||
for backup in $(echo "$backup_list" |head -n $backups_rm_number); do
|
||||
backup_date=$(echo $backup |sed -e "s/$user.//" -e "s/.tar.*$//")
|
||||
echo -e "$(date "+%F %T") Rotated sftp backup: $backup_date" |\
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue