2
0
Fork 0

Fix weed.sh script

This allows it to work with the naming convention used by the backup
script.

Fixes: #2753
This commit is contained in:
Wesley Aptekar-Cassels 2023-03-21 20:33:16 -04:00
parent 6d404558c3
commit a0b8adf3a9

View file

@ -84,8 +84,8 @@ function weed_directory {
for date_file in $( for date_file in $(
find "$directory" \ find "$directory" \
-maxdepth 1 \ -maxdepth 1 \
-name 'backup__[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]\.sql' \ -name 'backup_[a-z]*_[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]\.sql' \
| sed 's/\(^.*backup__\([0-9-]*\)\.sql$\)/\2\1/' \ | sed 's/\(^.*backup_[a-z]*_\([0-9-]*\)\.sql$\)/\2\1/' \
| sort --reverse | sort --reverse
); do ); do
date="${date_file:0:10}" date="${date_file:0:10}"