diff --git a/install/install.sh b/install/install.sh index c97b417..04c49e3 100755 --- a/install/install.sh +++ b/install/install.sh @@ -4,6 +4,11 @@ # You may also need to use sudo to invoke the script unless you already have the correct # permissions to switch user (su) +# NOTE: +# This install is designed to be run in place at the webserver location. It is not meant to be run from a +# dev environment. For that use update-from-dev.sh + + # Params check if [ $# != 1 ]; then echo "There must be 1 args. Usage:" diff --git a/install/rsync-exclude.txt b/install/rsync-exclude.txt new file mode 100644 index 0000000..075337e --- /dev/null +++ b/install/rsync-exclude.txt @@ -0,0 +1 @@ +html/inc/.htaccess diff --git a/install/update-from-dev.sh b/install/update-from-dev.sh new file mode 100755 index 0000000..85af382 --- /dev/null +++ b/install/update-from-dev.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +# 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 +