admin scripts
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
487 B

  1. #!/bin/bash
  2. #date=`/bin/date +%Y%m%d`
  3. date=20080830
  4. success=0
  5. loops=0
  6. while [ $success -eq 0 ]; do
  7. success=`grep -c success /backup/mysql/$date/summary`
  8. if [ $success -gt 0 ]; then
  9. files=`find /backup/mysql/$date/tree/dumps/ -type f -printf "%P \n"`
  10. for file in $files; do
  11. username=${file%.sql}
  12. group=`id -g $username`
  13. chown $username:$group /backup/mysql/$date/tree/dumps/$file
  14. done
  15. elif [ $loops -gt 12 ]; then
  16. exit 1
  17. els
  18. $loops++
  19. sleep 1800
  20. fi
  21. done