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

View file

@ -247,13 +247,13 @@ fi
# #
# Let's do the backup - here begins the real stuff # Let's do the backup - here begins the real stuff
# #
current_source=0 source_no=0
while [ "${current_source}" -lt "${no_sources}" ]; do while [ "${source_no}" -lt "${no_sources}" ]; do
# #
# Get current source # Get current source
# #
eval name=\"\$source_${current_source}\" eval name=\"\$source_${source_no}\"
current_source=$((${current_source}+1)) source_no=$((${source_no}+1))
export name export name
@ -494,7 +494,7 @@ while [ "${current_source}" -lt "${no_sources}" ]; do
fi fi
# set time when we really begin to backup, not when we began to remove above # 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_dir="${ddir}/${destination_name}"
export destination_full="${destination}/${destination_name}" export destination_full="${destination}/${destination_name}"