mirror of
https://github.com/myvesta/vesta
synced 2025-08-14 18:49:21 -07:00
backup pages
This commit is contained in:
parent
b0d5764cae
commit
7a99bd4ad0
7 changed files with 153 additions and 4 deletions
|
@ -390,6 +390,9 @@ local_backup(){
|
|||
chown nginx:$user $BACKUP/$user.$DATE.tar
|
||||
localbackup='yes'
|
||||
echo
|
||||
|
||||
U_BACKUPS=$(ls $BACKUP/|grep "^$user."|wc -l)
|
||||
update_user_value "$user" '$U_BACKUPS' "$U_BACKUPS"
|
||||
}
|
||||
|
||||
|
||||
|
|
53
bin/v_delete_user_backup
Executable file
53
bin/v_delete_user_backup
Executable file
|
@ -0,0 +1,53 @@
|
|||
#!/bin/bash
|
||||
# info: delete user backup
|
||||
# options: user nackup
|
||||
#
|
||||
# The function deletes user backup.
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Variable&Function #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
# Argument defenition
|
||||
user=$1
|
||||
backup=$(echo $2| cut -f 2 -d \.)
|
||||
|
||||
# Includes
|
||||
source $VESTA/conf/vesta.conf
|
||||
source $VESTA/func/main.sh
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Verifications #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
check_args '2' "$#" 'user backup'
|
||||
validate_format 'user' 'backup'
|
||||
is_system_enabled "$BACKUP_SYSTEM"
|
||||
is_object_valid 'user' 'USER' "$user"
|
||||
is_object_unsuspended 'user' 'USER' "$user"
|
||||
is_object_valid 'backup' 'BACKUP' "$2"
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Action #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
# Deleting backup
|
||||
rm -f $BACKUP/$2
|
||||
sed -i "/BACKUP='$2' /d" $USER_DATA/backup.conf
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Vesta #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
# Update counter
|
||||
U_BACKUPS=$(ls $BACKUP/|grep "^$user."|wc -l)
|
||||
update_user_value "$user" '$U_BACKUPS' "$U_BACKUPS"
|
||||
|
||||
# Logging
|
||||
log_history "$EVENT"
|
||||
log_event "$OK" "$EVENT"
|
||||
|
||||
exit
|
Loading…
Add table
Add a link
Reference in a new issue