union calls for FTP/SFTP backups

This commit is contained in:
Serghey Rodin 2015-05-29 01:45:15 +03:00
commit 003cbbea47
5 changed files with 106 additions and 206 deletions

45
bin/v-delete-backup-host Executable file
View file

@ -0,0 +1,45 @@
#!/bin/bash
# info: delete backup ftp server
# options: NONE
#
# The function deletes ftp backup host
#----------------------------------------------------------#
# Variable&Function #
#----------------------------------------------------------#
# Includes
source $VESTA/func/main.sh
source $VESTA/conf/vesta.conf
#----------------------------------------------------------#
# Verifications #
#----------------------------------------------------------#
#----------------------------------------------------------#
# Action #
#----------------------------------------------------------#
# Checking network connection
rm -f $VESTA/conf/ftp.backup.conf
#----------------------------------------------------------#
# Vesta #
#----------------------------------------------------------#
# Update vesta.conf
bckp=$(echo "$BACKUP_SYSTEM" |\
sed "s/,/\n/g"|\
sed "s/^ftp$//" |\
sed "/^$/d"|\
sed ':a;N;$!ba;s/\n/,/g')
sed -i "s/BACKUP_SYSTEM=.*/BACKUP_SYSTEM='$bckp'/g" $VESTA/conf/vesta.conf
# Logging
log_event "$OK" "$EVENT"
exit