v_backup_users 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #!/bin/bash
  2. # info: backup all users
  3. # options: none
  4. #
  5. # The function backups all system users.
  6. #----------------------------------------------------------#
  7. # Variable&Function #
  8. #----------------------------------------------------------#
  9. # Importing system enviroment as we run this script
  10. # mostly by cron wich not read it by itself
  11. source /etc/profile.d/vesta.sh
  12. # Importing variables
  13. source $VESTA/conf/vars.conf
  14. source $V_CONF/vesta.conf
  15. source $V_FUNC/shared.func
  16. #----------------------------------------------------------#
  17. # Action #
  18. #----------------------------------------------------------#
  19. user_list=$(ls $V_USERS/)
  20. # Updating user billing
  21. for user in $user_list; do
  22. $V_BIN/v_backup_user $user >> $V_LOG/backup.log 2>> $V_LOG/backup.log
  23. done
  24. #----------------------------------------------------------#
  25. # Vesta #
  26. #----------------------------------------------------------#
  27. # Logging
  28. log_event 'system' "$V_EVENT"
  29. exit