Files
VestaCP/bin/v_add_user_backup
2012-01-10 17:10:18 +02:00

57 lines
1.3 KiB
Bash
Executable File

#!/bin/bash
# info: schedule user backup creation
# options: user
#
# The function for scheduling user backup creation.
#----------------------------------------------------------#
# Variable&Function #
#----------------------------------------------------------#
# Argument defenition
user=$1
# Importing variables
source $VESTA/conf/vars.conf
source $V_CONF/vesta.conf
source $V_FUNC/shared.func
#----------------------------------------------------------#
# Verifications #
#----------------------------------------------------------#
# Checking arg number
check_args '1' "$#" 'user'
# Checking argument format
format_validation 'user'
# Checking backup system is enabled
is_system_enabled 'backup'
# Checking user
is_user_valid
# Checking user backups
is_backup_enabled
#----------------------------------------------------------#
# Action #
#----------------------------------------------------------#
# Adding backup to pipe
echo "$user" >> $V_QUEUE/backup.pipe
#----------------------------------------------------------#
# Vesta #
#----------------------------------------------------------#
# Logging
log_event 'system' "$V_EVENT"
exit