Added source specific verbose option

This commit is contained in:
Nico Schottelius 2005-12-08 11:08:15 +01:00
parent b3c5c9acc8
commit d440c7b4d7
2 changed files with 22 additions and 3 deletions

View file

@ -28,3 +28,15 @@ Below this directory should be:
2. Source configuration 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

View file

@ -152,6 +152,7 @@ while [ "$i" -lt "$no_shares" ]; do
c_source="$backup/source" c_source="$backup/source"
c_dest="$backup/destination" c_dest="$backup/destination"
c_exclude="$backup/exclude" c_exclude="$backup/exclude"
c_verbose="$backup/verbose"
echo "/=> Beginning to backup \"$name\" ..." echo "/=> Beginning to backup \"$name\" ..."
i=$[$i+1] i=$[$i+1]
@ -207,12 +208,18 @@ while [ "$i" -lt "$no_shares" ]; do
continue continue
fi fi
# exclude
if [ -f "$c_exclude" ]; then if [ -f "$c_exclude" ]; then
while read tmp; do while read tmp; do
EXCLUDE="$EXCLUDE --exclude \"$tmp\"" EXCLUDE="$EXCLUDE --exclude=\"$tmp\""
done < "$c_exclude" done < "$c_exclude"
fi fi
# verbose
if [ -f "$c_verbose" ]; then
VERBOSE="-v"
fi
# #
# check if maximum number of backups is reached, if so remove # 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 # only copy if a directory exists
if [ "$last_dir" ]; then if [ "$last_dir" ]; then
echo cp -al "$last_dir" "$destination_dir" echo cp -al "$last_dir" "$destination_dir"
cp -al "$last_dir" "$destination_dir" cp $VERBOSE -al "$last_dir" "$destination_dir"
else else
mkdir "$destination_dir" mkdir "$destination_dir"
fi fi
@ -282,4 +289,4 @@ if [ "$PARALLEL" = 1 ]; then
fi fi
rm -f "$TMP" rm -f "$TMP"
echo "\o> Finished complety backup process." echo "\o> Finished $WE."