- #!/bin/bash
-
- # In general, you should be developing the files in the web area rather than somewhere else. This script is
- # only to provide a copy facility where you might not wish to go via the repository.
-
- # This file will update the local web environment by copying over the dev files
- # TODO: Database update are not yet handled and must be performed manually
-
- # NOTE:
- # There will be a conflict if trying up update the web files from the main repository since the dev environment is the place
- # where commits should take place. So the dev-web area will already contain those updates and a pull will likely fail.
-
- # TODO: I need to modify the install.sh script to pull and overwrite somehow.
-
-
- # Params check
- if [ $# != 1 ]; then
- echo "There must be 1 args. Usage:"
- echo "./update-from-dev.sh www-data"
- exit;
- fi
-
- webuser=$1
- PATH_SRC=../html
- BKUP_DEST=/var/www/backup-commander
-
- # -anv dry run
- # -a archive
-
- sudo su -s /bin/bash $webuser << EOF
- echo "Copying to $BKUP_DEST"
- rsync -a --exclude-from=rsync-exclude.txt $PATH_SRC $BKUP_DEST
- EOF
-