From d440c7b4d7c1340c706def01c6c8aa777c140559 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Thu, 8 Dec 2005 11:08:15 +0100 Subject: [PATCH] Added source specific verbose option --- CONFIGURATION | 12 ++++++++++++ ccollect.sh | 13 ++++++++++--- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/CONFIGURATION b/CONFIGURATION index bf806f1..a5fd287 100644 --- a/CONFIGURATION +++ b/CONFIGURATION @@ -28,3 +28,15 @@ Below this directory should be: 2. Source configuration +Each source configuration exists below $CCOLLECT_CONF/sources/$name. +The name describes the source. + +Each source has at least + + - source (a text file containing the path to backup) + - destination (a link to the directory we should backup to) + +Additionally a source may have the following files: + + - verbose whether to be verbose + - exclude excludes for rsync. One exclude specification on each line diff --git a/ccollect.sh b/ccollect.sh index cc8b321..fcdd1c7 100755 --- a/ccollect.sh +++ b/ccollect.sh @@ -152,6 +152,7 @@ while [ "$i" -lt "$no_shares" ]; do c_source="$backup/source" c_dest="$backup/destination" c_exclude="$backup/exclude" + c_verbose="$backup/verbose" echo "/=> Beginning to backup \"$name\" ..." i=$[$i+1] @@ -207,12 +208,18 @@ while [ "$i" -lt "$no_shares" ]; do continue fi + # exclude if [ -f "$c_exclude" ]; then while read tmp; do - EXCLUDE="$EXCLUDE --exclude \"$tmp\"" + EXCLUDE="$EXCLUDE --exclude=\"$tmp\"" done < "$c_exclude" fi + # verbose + if [ -f "$c_verbose" ]; then + VERBOSE="-v" + fi + # # check if maximum number of backups is reached, if so remove # @@ -246,7 +253,7 @@ while [ "$i" -lt "$no_shares" ]; do # only copy if a directory exists if [ "$last_dir" ]; then echo cp -al "$last_dir" "$destination_dir" - cp -al "$last_dir" "$destination_dir" + cp $VERBOSE -al "$last_dir" "$destination_dir" else mkdir "$destination_dir" fi @@ -282,4 +289,4 @@ if [ "$PARALLEL" = 1 ]; then fi rm -f "$TMP" -echo "\o> Finished complety backup process." +echo "\o> Finished $WE."