From c2226f913411efb3280c359d683be64f5cc4e736 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sun, 1 Nov 2009 15:07:50 +0100 Subject: [PATCH] BUGFIX: Use different destination directory based on the source number If you have muliple sources, that go into the same destination directory or specify a source mulitple times on the command line and the backup is done within a minute, the destination directory will still be the name: 497 export destination_name="${INTERVAL}.$(${CDATE}).$$" None of the values will change for the next backup. Thus the new format since ccollect 0.8.1 is 497 export destination_name="${INTERVAL}.$(${CDATE}).$$-${source_no}" which contains the number of the current source. Signed-off-by: Nico Schottelius --- ccollect.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ccollect.sh b/ccollect.sh index 9fb73c3..491710d 100755 --- a/ccollect.sh +++ b/ccollect.sh @@ -247,13 +247,13 @@ fi # # Let's do the backup - here begins the real stuff # -current_source=0 -while [ "${current_source}" -lt "${no_sources}" ]; do +source_no=0 +while [ "${source_no}" -lt "${no_sources}" ]; do # # Get current source # - eval name=\"\$source_${current_source}\" - current_source=$((${current_source}+1)) + eval name=\"\$source_${source_no}\" + source_no=$((${source_no}+1)) export name @@ -494,7 +494,7 @@ while [ "${current_source}" -lt "${no_sources}" ]; do fi # set time when we really begin to backup, not when we began to remove above - export destination_name="${INTERVAL}.$(${CDATE}).$$" + export destination_name="${INTERVAL}.$(${CDATE}).$$-${source_no}" export destination_dir="${ddir}/${destination_name}" export destination_full="${destination}/${destination_name}"