diff --git a/.gitignore b/.gitignore index de3b1ef..246724e 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ html/data/* html/inc/paths.php install/conf.php +html/svc/BU-commander diff --git a/README.md b/README.md index 14e8c1f..76b57b8 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ Backup Commander is a simple web-based backup platform powered by PHP offering: -- Easy installation +- Easy installation (used to be anyway) - Intuitive UI - Incremental file backup - Backup scheduling @@ -48,18 +48,3 @@ └─js All JS files └─install Install and update scripts - - -### TODO --------- - -
- create the schedule runner in php. simple polling of the DB - update install script to ask questions to fill in details for conf.php - - get passwords from BD - create a user credential page: - new user+password - change own password - but only if the login is enabled (in post_handler.php) -diff --git a/git-info.sh b/git-info.sh new file mode 100755 index 0000000..f137dac --- /dev/null +++ b/git-info.sh @@ -0,0 +1,40 @@ +#!/bin/bash + +# author: Duane Johnson +# email: duane.johnson@gmail.com +# date: 2008 Jun 12 +# license: MIT +# +# Based on discussion at http://kerneltrap.org/mailarchive/git/2007/11/12/406496 + +pushd . >/dev/null + +# Find base of git directory +while [ ! -d .git ] && [ ! `pwd` = "/" ]; do cd ..; done + +# Show various information about this git directory +if [ -d .git ]; then + echo "== Remote URL: `git remote -v`" + + echo "== Remote Branches: " + git branch -r + echo + + echo "== Local Branches:" + git branch + echo + + echo "== Configuration (.git/config)" + cat .git/config + echo + + echo "== Most Recent Commit" + git log -1 + echo + + echo "Type 'git log' for more commits, or 'git show' for full commit details." +else + echo "Not a git repository." +fi + +popd >/dev/null 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..5d03ddf --- /dev/null +++ b/install/rsync-exclude.txt @@ -0,0 +1,2 @@ +html/inc/.htaccess +html/svc/BU-commander 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 +