mirror of
https://github.com/myvesta/vesta
synced 2025-08-20 13:24:25 -07:00
Introducing ONLY_ONE_FTP_BACKUP variable
This commit is contained in:
parent
caf3e97d5c
commit
6a6cfe969a
1 changed files with 18 additions and 0 deletions
|
@ -636,6 +636,11 @@ ftp_backup() {
|
|||
else
|
||||
backup_list=$(ftpc "cd $BPATH" "ls" |awk '{print $9}' |grep "^$user\.")
|
||||
fi
|
||||
if [ ! -z "$ONLY_ONE_FTP_BACKUP" ]; then
|
||||
TEMP_BACKUPS=$BACKUPS
|
||||
BACKUPS=1
|
||||
echo "=== Set BACKUPS=1"
|
||||
fi
|
||||
backups_count=$(echo "$backup_list" |wc -l)
|
||||
if [ "$backups_count" -ge "$BACKUPS" ]; then
|
||||
backups_rm_number=$((backups_count - BACKUPS + 1))
|
||||
|
@ -650,6 +655,10 @@ ftp_backup() {
|
|||
fi
|
||||
done
|
||||
fi
|
||||
if [ ! -z "$ONLY_ONE_FTP_BACKUP" ]; then
|
||||
BACKUPS=$TEMP_BACKUPS
|
||||
echo "=== Bringing back old value BACKUPS=$BACKUPS"
|
||||
fi
|
||||
|
||||
# Uploading backup archive
|
||||
if [ "$localbackup" = 'yes' ]; then
|
||||
|
@ -792,6 +801,11 @@ sftp_backup() {
|
|||
backup_list=$(sftpc "cd $BPATH" "ls -l" |awk '{print $9}'|grep "^$user\.")
|
||||
fi
|
||||
backups_count=$(echo "$backup_list" |wc -l)
|
||||
if [ ! -z "$ONLY_ONE_FTP_BACKUP" ]; then
|
||||
TEMP_BACKUPS=$BACKUPS
|
||||
BACKUPS=1
|
||||
echo "=== Set BACKUPS=1"
|
||||
fi
|
||||
if [ "$backups_count" -ge "$BACKUPS" ]; then
|
||||
backups_rm_number=$((backups_count - BACKUPS + 1))
|
||||
for backup in $(echo "$backup_list" |head -n $backups_rm_number); do
|
||||
|
@ -805,6 +819,10 @@ sftp_backup() {
|
|||
fi
|
||||
done
|
||||
fi
|
||||
if [ ! -z "$ONLY_ONE_FTP_BACKUP" ]; then
|
||||
BACKUPS=$TEMP_BACKUPS
|
||||
echo "=== Bringing back old value BACKUPS=$BACKUPS"
|
||||
fi
|
||||
|
||||
# Uploading backup archive
|
||||
echo "$(date "+%F %T") Uploading $user.$backup_new_date.tar"|tee -a $BACKUP/$user.log
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue