Newer
Older
backup-commander / install / update-from-dev.sh
@John P on MM John P on MM on 2 Dec 1 KB wip
  1. #!/bin/bash
  2.  
  3. # In general, you should be developing the files in the web area rather than somewhere else. This script is
  4. # only to provide a copy facility where you might not wish to go via the repository.
  5.  
  6. # This file will update the local web environment by copying over the dev files
  7. # TODO: Database update are not yet handled and must be performed manually
  8.  
  9. # NOTE:
  10. # There will be a conflict if trying up update the web files from the main repository since the dev environment is the place
  11. # where commits should take place. So the dev-web area will already contain those updates and a pull will likely fail.
  12.  
  13. # TODO: I need to modify the install.sh script to pull and overwrite somehow.
  14.  
  15.  
  16. # Params check
  17. if [ $# != 1 ]; then
  18. echo "There must be 1 args. Usage:"
  19. echo "./update-from-dev.sh www-data"
  20. exit;
  21. fi
  22.  
  23. webuser=$1
  24. PATH_SRC=../html
  25. BKUP_DEST=/var/www/backup-commander
  26.  
  27. # -anv dry run
  28. # -a archive
  29.  
  30. sudo su -s /bin/bash $webuser << EOF
  31. echo "Copying to $BKUP_DEST"
  32. rsync -a --exclude-from=rsync-exclude.txt $PATH_SRC $BKUP_DEST
  33. EOF
  34.