| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- #!/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
|