Commit 422302cc authored by Fjen Undso's avatar Fjen Undso
Browse files

support databases with same name prefix

parent dbd8c4f3
......@@ -92,15 +92,16 @@ mydumper -u "$MYUSER" -p "$MYPASS" -h "$MYHOST" --regex "$EXLUDEDBS" -o "$backup
### Compression
echo "### Compression..."
cd "$backupdir"
# format: db.table.sql or db-schema-create.sql
dbs=$(ls *.sql | cut -d "." -f 1 | cut -d "-" -f 1 | sort | uniq)
for db in $dbs; do
echo "compress: $db"
if [ "$USETAR" -eq 1 ]; then
tar cf "$db.tar" "$db"* \
&& rm "$db"*.sql
tar cf "$db.tar" "$db"[.-]* \
&& rm "$db"[.-]*.sql
fi
[ -n "$COMPRESS" ] \
&& $COMPRESS "$db"*
&& $COMPRESS "$db"[.-]*
done
cd -
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment