Answer the question
In order to leave comments, you need to log in
How can you organize database dumps into folders?
Hello!
All databases on the server are named prefix_name
How can I put a dump of each database in / prefix / prefix_name .sql.gz ?
Answer the question
In order to leave comments, you need to log in
Script in a hurry
#!/bin/bash
target=`echo $1 | cut -f1 -d'_'`
mkdir $target
mv "$target"_* ./$target/
In the directory with dumps, call the script, passing it the name of the dump as an argument
mover.sh prefix_name.sql.gz
In the script with which you make a backup, create a directory and put the backup in this directory.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question