diff --git a/README b/README index 23a5e38..580abaf 100644 --- a/README +++ b/README @@ -46,6 +46,9 @@ $CCOLLECT_CONF/ If this file exists in the source specification -v will be passed to rsync. +-------------------------------------------------------------------------------- + exclude - a new line seperated list of paths to exclude + -------------------------------------------------------------------------------- destination - a link to the destination directory diff --git a/REQUIREMENTS b/REQUIREMENTS new file mode 100644 index 0000000..23c6652 --- /dev/null +++ b/REQUIREMENTS @@ -0,0 +1,11 @@ +-------------------------------------------------------------------------------- +ccollect.sh, Nico Schottelius, 2005-12-06 +Requirements +-------------------------------------------------------------------------------- + +You need at least: + + - rsync + - cp with support for hard links + - ssh if you want to use rsync over ssh + - a bourne shell (/bin/sh) compatible shell diff --git a/ccollect.sh b/ccollect.sh index 6e7205b..b0527b3 100755 --- a/ccollect.sh +++ b/ccollect.sh @@ -40,7 +40,7 @@ errecho() # usage() { - echo "$(basename $0): [args] " + echo "$(basename $0): [args] " echo "" echo " Nico Schottelius (nico-linux-ccollect schottelius.org) - 2005-12-06" echo "" @@ -135,6 +135,12 @@ while [ "$i" -lt "$no_shares" ]; do c_dest="$backup/destination" c_exclude="$backup/exclude" + # + # standard rsync options + # + VERBOSE="" + EXCLUDE="" + i=$((i+1)) echo "Beginning to backup \"$name\" ..." @@ -166,7 +172,27 @@ while [ "$i" -lt "$no_shares" ]; do if [ -f "$c_exclude" ]; then errecho "Destination $c_dest does not link to a directory. Skipping." continue + + while read tmp; do + EXCLUDE="$EXCLUDE --exclude \"$tmp\"" + done < "$c_exclude" fi + + # + # clone the old directory with hardlinks + # + + # + # the rsync part + # + echo rsync --delete $VERBOSE $EXCLUDE done +# +# Be a good parent and wait for our children, if they are running wild parallel +# +if [ "$PARALLEL" = 1 ]; then + wait +fi + rm -f "$TMP"