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:
parent
6d404558c3
commit
a0b8adf3a9
1 changed files with 3 additions and 3 deletions
|
@ -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}"
|
||||||
|
|
Loading…
Add table
Reference in a new issue