backup restoration 90% completed

This commit is contained in:
Serghey Rodin 2013-03-28 01:12:57 +02:00
commit 65db51189c
16 changed files with 330 additions and 99 deletions

56
bin/v-schedule-user-restore Executable file
View file

@ -0,0 +1,56 @@
#!/bin/bash
# info: schedule user backup restoration
# options: USER BACKUP [WEB] [DNS] [MAIL] [DB] [CRON] [UDIR]
#
# The function for scheduling user backup restoration.
#----------------------------------------------------------#
# Variable&Function #
#----------------------------------------------------------#
# Argument defenition
user=$1
backup=$2
web=$3
dns=$4
mail=$5
db=$6
cron=$7
udir=$8
# Includes
source $VESTA/conf/vesta.conf
source $VESTA/func/main.sh
#----------------------------------------------------------#
# Verifications #
#----------------------------------------------------------#
check_args '2' "$#" 'USER BACKUP [WEB] [DNS] [MAIL] [DB] [CRON] [UDIR]'
validate_format 'user'
is_system_enabled "$BACKUP_SYSTEM"
is_object_valid 'user' 'USER' "$user"
is_backup_enabled
is_backup_scheduled 'restore'
#----------------------------------------------------------#
# Action #
#----------------------------------------------------------#
# Adding restore task to the queue
options="'$web' '$dns' '$mail' '$db' '$cron' '$udir'"
echo "$BIN/v-restore-user $user $backup $options yes" \
>> $VESTA/data/queue/backup.pipe
#----------------------------------------------------------#
# Vesta #
#----------------------------------------------------------#
# Logging
log_event "$OK" "$EVENT"
exit