| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- #!/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/vesta.conf
- source $VESTA/func/shared.sh
- #----------------------------------------------------------#
- # Verifications #
- #----------------------------------------------------------#
- # Checking arg number
- check_args '1' "$#" 'user'
- # Checking argument format
- validate_format 'user'
- # Checking backup system is enabled
- is_system_enabled 'BACKUP_SYSTEM'
- # Checking user
- is_object_valid 'user' 'USER' "$user"
- # Checking user backups
- is_backup_enabled
- #----------------------------------------------------------#
- # Action #
- #----------------------------------------------------------#
- # Adding backup to pipe
- echo "$user" >> $VESTA/data/queue/backup.pipe
- #----------------------------------------------------------#
- # Vesta #
- #----------------------------------------------------------#
- # Logging
- log_event "$OK" "$EVENT"
- exit
|