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 <nico@ikn.schottelius.org>
This commit is contained in:
Nico Schottelius 2009-11-01 15:07:50 +01:00
parent 0f7891de8d
commit c2226f9134
1 changed files with 5 additions and 5 deletions

View File

@ -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}"