Skip to content

Commit 005887c

Browse files
wip
1 parent 854ca3a commit 005887c

File tree

2 files changed

+10
-15
lines changed

2 files changed

+10
-15
lines changed

backup/bareos_pool_operations/README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,8 @@ Action for the range of volumes in the pool with 'name_mask' (something like 'In
107107
skip confirmation request or 'print' to get the info about the selected range of volumes. 'print' will not perform
108108
changes in volume status, just output info. Specifying `<pool_path_for_dumb>` will affect only for 'dumb' action.
109109

110-
Action 'dumb' will create a range of an empty volume files (via `touch`
111-
command). Creating 'dumb' volumes required when you have removed existing volume by mistake, but it still exists in a
112-
Bareos database.
110+
Action 'dumb' will create a range of an empty volume files (via `touch`command). Creating 'dumb' volumes required when
111+
you have removed existing volume by mistake, but it still exists in a Bareos database.
113112

114113
## Other Bareos troubleshooting examples
115114

backup/bareos_pool_operations/batch_process_bareos_volumes.sh

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -83,26 +83,22 @@ done
8383
[[ -z $VOL_OPT || $VOL_OPT =~ ^(force|print)$ ]] || { error "Error: option should be empty, 'force' or 'print'."; }
8484
[[ $VOL_START =~ ^[0-9]+$ ]] || { error "Error: start volume is not a number."; }
8585
[[ $VOL_END =~ ^[0-9]+$ ]] || { error "Error: end volume is not a number."; }
86-
8786
if $USAGE_ERR; then
8887
usage
8988
fi
9089

9190
echo "WARNING! This will process selected range of volumes in Bareos pool:"
9291
echo "${VOL_ACTION} from ${VOL_START} to ${VOL_END} by mask ${VOL_MASK}"
93-
read -p "Press Enter to proceed or Ctrl+C to abort..."
92+
read -r -p "Press Enter to proceed or Ctrl+C to abort..."
9493

95-
if [[ $VOL_ACTION == "dumb" ]]; then
96-
for RANGE_ITEM in $(seq -w "$VOL_START" "$VOL_END"); do
97-
RANGE_FILE="$VOL_MASK$RANGE_ITEM"
98-
echo "Creating an empty '$RANGE_FILE'..."
99-
touch "$VOL_PATH/$RANGE_FILE"
100-
done
101-
else
102-
for RANGE_ITEM in $(eval "echo {$VOL_START..$VOL_END}"); do
94+
for RANGE_ITEM in $(seq -w "$VOL_START" "$VOL_END"); do
95+
if [[ $VOL_ACTION == "dumb" ]]; then
96+
echo "Creating an empty '${VOL_MASK}${RANGE_ITEM}'..."
97+
touch "$VOL_PATH/${VOL_MASK}${RANGE_ITEM}"
98+
else
10399
echo "${VOL_ACTION} volume: ${VOL_MASK}${RANGE_ITEM} $VOL_OPT"
104100
if [[ $VOL_OPT != 'print' ]]; then
105101
echo "${VOL_ACTION} volume=${VOL_MASK}${RANGE_ITEM} $([[ $VOL_OPT == 'force' ]] && echo 'yes')" | bconsole
106102
fi
107-
done
108-
fi
103+
fi
104+
done

0 commit comments

Comments
 (0)