Closed bonelifer closed 9 years ago
Specifically ignoring tables with a specific prefix.
It's simple enough to exclude certain databases. Just add a variable EXCLUDE_DB in the config section, which is a space separated list of database names. Then, as first line inside the for-loop where the backup script loops over the databases, add something like
[[ "$EXCLUDE_DB" =~ (^|[[:space:]])"$db"($|[[:space:]]) ]] && continue
The =~
operator checks if the item is in the list, and the continue
command tells the for-loop to skip to the next database.
The actual code is left as an exercise to the reader.
Your other question, about excluding tables with a specific prefix, is a totally different beast, which should be a different issue. (And the answer will be: that is A LOT more work).
Hi, please have a look at the master branch and v1.3 tag. I've added support for filtering of databases and a dry run mode. If there's any trouble with the new features please open a fresh issue here and I'll address it.
One missing feature would be to be able to exclude certain db's, so that they are never backed up.