v_add_user_backup 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #!/bin/bash
  2. # info: schedule user backup creation
  3. # options: user
  4. #
  5. # The function for scheduling user backup creation.
  6. #----------------------------------------------------------#
  7. # Variable&Function #
  8. #----------------------------------------------------------#
  9. # Argument defenition
  10. user=$1
  11. # Importing variables
  12. source $VESTA/conf/vesta.conf
  13. source $VESTA/func/shared.sh
  14. #----------------------------------------------------------#
  15. # Verifications #
  16. #----------------------------------------------------------#
  17. # Checking arg number
  18. check_args '1' "$#" 'user'
  19. # Checking argument format
  20. validate_format 'user'
  21. # Checking backup system is enabled
  22. is_system_enabled 'BACKUP_SYSTEM'
  23. # Checking user
  24. is_object_valid 'user' 'USER' "$user"
  25. # Checking user backups
  26. is_backup_enabled
  27. #----------------------------------------------------------#
  28. # Action #
  29. #----------------------------------------------------------#
  30. # Adding backup to pipe
  31. echo "$user" >> $VESTA/data/queue/backup.pipe
  32. #----------------------------------------------------------#
  33. # Vesta #
  34. #----------------------------------------------------------#
  35. # Logging
  36. log_event "$OK" "$EVENT"
  37. exit