From e95a2ea208e7b2d3097a621b0748ca5abb7a8818 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sun, 19 Mar 2006 01:10:58 +0100 Subject: [PATCH] Replaced cp with pax --- ccollect.sh | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/ccollect.sh b/ccollect.sh index 04d8bf2..f955e47 100755 --- a/ccollect.sh +++ b/ccollect.sh @@ -299,16 +299,16 @@ while [ "$i" -lt "$no_shares" ]; do RSYNC_EXTRA="$(cat "$c_rsync_extra")" fi - # verbosity for rsync - if [ -f "$c_verbose" ]; then - VERBOSE="-v" - fi - # Output a summary if [ -f "$c_summary" ]; then SUMMARY="--stats" fi + # verbosity for rsync + if [ -f "$c_verbose" ]; then + VERBOSE="-v" + fi + # MORE verbosity, includes standard verbosity if [ -f "$c_vverbose" ]; then VERBOSE="-v" @@ -349,13 +349,16 @@ while [ "$i" -lt "$no_shares" ]; do # give some info echo "Beginning to backup, this may take some time..." + echo "Creating $destination_dir ..." + mkdir $VVERBOSE "$destination_dir" + # only copy if a directory exists if [ "$last_dir" ]; then echo "$(date) Hard linking..." - cp -al $VVERBOSE "$last_dir" "$destination_dir" - else - echo "Creating $destination_dir" - mkdir $VVERBOSE "$destination_dir" + cd "$last_dir" + pax -r -w -l $VVERBOSE . "../$destination_dir" + # old, gnu cp specific + # cp -al $VVERBOSE "$last_dir" "$destination_dir" fi if [ $? -ne 0 ]; then