Merge pull request #2754 from WesleyAC/production-fix-weed-script

Fix weed.sh script
This commit is contained in:
Mouse Reeve 2023-03-21 17:57:07 -07:00 committed by GitHub
commit 154f23719b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -84,8 +84,8 @@ function weed_directory {
for date_file in $(
find "$directory" \
-maxdepth 1 \
-name 'backup__[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/' \
-name 'backup_[a-z]*_[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]\.sql' \
| sed 's/\(^.*backup_[a-z]*_\([0-9-]*\)\.sql$\)/\2\1/' \
| sort --reverse
); do
date="${date_file:0:10}"
@ -182,4 +182,4 @@ function main(){
if [ "${BASH_SOURCE[0]}" -ef "$0" ]; then
main "$@"
fi
fi