v_add_user_backup 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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/vars.conf
  13. source $V_CONF/vesta.conf
  14. source $V_FUNC/shared.func
  15. #----------------------------------------------------------#
  16. # Verifications #
  17. #----------------------------------------------------------#
  18. # Checking arg number
  19. check_args '1' "$#" 'user'
  20. # Checking argument format
  21. format_validation 'user'
  22. # Checking backup system is enabled
  23. is_system_enabled 'backup'
  24. # Checking user
  25. is_user_valid
  26. # Checking user backups
  27. is_backup_enabled
  28. #----------------------------------------------------------#
  29. # Action #
  30. #----------------------------------------------------------#
  31. # Adding backup to pipe
  32. echo "$user" >> $V_QUEUE/backup.pipe
  33. #----------------------------------------------------------#
  34. # Vesta #
  35. #----------------------------------------------------------#
  36. # Logging
  37. log_event 'system' "$V_EVENT"
  38. exit