v-backup-users 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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
  12. # Includes
  13. source $VESTA/conf/vesta.conf
  14. source $VESTA/func/main.sh
  15. #----------------------------------------------------------#
  16. # Action #
  17. #----------------------------------------------------------#
  18. for user in $(ls $VESTA/data/users); do
  19. check_suspend=$(grep "SUSPENDED='no'" $VESTA/data/users/$user/user.conf)
  20. if [ ! -z "$check_suspend" ]; then
  21. $BIN/v-backup-user $user >> $VESTA/log/backup.log 2>&1
  22. fi
  23. done
  24. #----------------------------------------------------------#
  25. # Vesta #
  26. #----------------------------------------------------------#
  27. # No Logging
  28. #log_event "$OK" "$EVENT"
  29. exit