Archive : Prune fix name matching.
This commit is contained in:
parent
418f4799c3
commit
4e882b0dda
|
@ -1,5 +1,5 @@
|
||||||
export _archive_pattern="_[0-9]{12}-[[:alnum:]]{40}.t[xg]z"
|
export _archive_pattern="_[0-9]{12}-[[:alnum:]]{40}.t[xg]z$"
|
||||||
export _archive_pattern_fast="_[0-9]{12}-[[:alnum:]]{40}.tgz"
|
export _archive_pattern_fast="_[0-9]{12}-[[:alnum:]]{40}.tgz$"
|
||||||
|
|
||||||
# Archive directories.
|
# Archive directories.
|
||||||
# All directories by default.
|
# All directories by default.
|
||||||
|
@ -131,7 +131,7 @@ function archive_prune() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
process() {
|
process() {
|
||||||
local prune=($(ls ${target}* | _filter_archive | sort -r | sed -e "1,${versions}d"))
|
local prune=($(ls | grep -E "^${target}${_archive_pattern}" | sort -r | sed -e "1,${versions}d"))
|
||||||
|
|
||||||
for archive in ${prune[@]}; do
|
for archive in ${prune[@]}; do
|
||||||
rm -- "${archive}" && echo "${archive}"
|
rm -- "${archive}" && echo "${archive}"
|
||||||
|
|
Reference in a new issue