mirror of
https://github.com/serghey-rodin/vesta.git
synced 2025-08-21 05:44:07 -07:00
option to disable local backups
This commit is contained in:
parent
2c420440ac
commit
0f7110b0e7
1 changed files with 16 additions and 5 deletions
|
@ -1,6 +1,6 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# info: delete backup ftp server
|
# info: delete backup ftp server
|
||||||
# options: NONE
|
# options: TYPE
|
||||||
#
|
#
|
||||||
# The function deletes ftp backup host
|
# The function deletes ftp backup host
|
||||||
|
|
||||||
|
@ -9,6 +9,9 @@
|
||||||
# Variable&Function #
|
# Variable&Function #
|
||||||
#----------------------------------------------------------#
|
#----------------------------------------------------------#
|
||||||
|
|
||||||
|
# Argument defenition
|
||||||
|
type=$1
|
||||||
|
|
||||||
# Includes
|
# Includes
|
||||||
source $VESTA/func/main.sh
|
source $VESTA/func/main.sh
|
||||||
source $VESTA/conf/vesta.conf
|
source $VESTA/conf/vesta.conf
|
||||||
|
@ -18,23 +21,31 @@ source $VESTA/conf/vesta.conf
|
||||||
# Verifications #
|
# Verifications #
|
||||||
#----------------------------------------------------------#
|
#----------------------------------------------------------#
|
||||||
|
|
||||||
|
check_args '1' "$#" 'TYPE [HOST]'
|
||||||
|
types=$(echo "$BACKUP_SYSTEM" |sed "s/,/\n/g" |grep "^$type$")
|
||||||
|
if [ -z "$types" ]; then
|
||||||
|
echo "Error: invalid backup type"
|
||||||
|
log_event "$E_INVALID" "$EVENT"
|
||||||
|
exit $E_INVALID
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
#----------------------------------------------------------#
|
#----------------------------------------------------------#
|
||||||
# Action #
|
# Action #
|
||||||
#----------------------------------------------------------#
|
#----------------------------------------------------------#
|
||||||
|
|
||||||
# Checking network connection
|
# Deleting host config
|
||||||
rm -f $VESTA/conf/ftp.backup.conf
|
rm -f $VESTA/conf/$type.backup.conf
|
||||||
|
|
||||||
|
|
||||||
#----------------------------------------------------------#
|
#----------------------------------------------------------#
|
||||||
# Vesta #
|
# Vesta #
|
||||||
#----------------------------------------------------------#
|
#----------------------------------------------------------#
|
||||||
|
|
||||||
# Update vesta.conf
|
# Updating vesta.conf
|
||||||
bckp=$(echo "$BACKUP_SYSTEM" |\
|
bckp=$(echo "$BACKUP_SYSTEM" |\
|
||||||
sed "s/,/\n/g"|\
|
sed "s/,/\n/g"|\
|
||||||
sed "s/^ftp$//" |\
|
sed "s/^$type$//" |\
|
||||||
sed "/^$/d"|\
|
sed "/^$/d"|\
|
||||||
sed ':a;N;$!ba;s/\n/,/g')
|
sed ':a;N;$!ba;s/\n/,/g')
|
||||||
sed -i "s/BACKUP_SYSTEM=.*/BACKUP_SYSTEM='$bckp'/g" $VESTA/conf/vesta.conf
|
sed -i "s/BACKUP_SYSTEM=.*/BACKUP_SYSTEM='$bckp'/g" $VESTA/conf/vesta.conf
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue