Advertisement
flipje

websvn-repo-copy

Aug 2nd, 2012
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.00 KB | None | 0 0
  1. #!/bin/bash
  2. # copy subversion repo's naar /data/subversion/www en geeft owner www-data
  3. # dit om een user colapse tussen rancid en www-data te voorkomen.
  4.  
  5. # exit functie
  6. function die() { echo -e "Error in ${SCRIPT_PATH}:\n${1}"; exit 1; }
  7.  
  8. # Global variables:
  9. PATH='/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin'
  10. SCRIPT_PATH="${0}"
  11. HOST="${1}"
  12. RSYNC="rsync -alqqz"
  13.  
  14.   # for loopje:
  15.   for SOURCEDIR in /data/subversion/rancid /data/subversion/configs
  16.   do
  17.      ${RSYNC} ${SOURCEDIR} /data/subversion/www || { echo "Failed to rsyc ${SOURCEDIR} to /data/subversion/www" ; continue; }
  18.   done
  19.  
  20.   # perms
  21.   chown -R www-data:www-data /data/subversion/www/ || die "failed to chown /data/subversion/www/ to www-data:www-data"
  22.   find /data/subversion/www/ -type f -exec chmod 600 {} \; || die "Failed to chmod 600 all files in /data/subversion/www/"
  23.   find /data/subversion/www/ -type d -exec chmod 700 {} \; || die "Failed to chmod 700 all directories in /data/subversion/www/"
  24.  
  25.   exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement