Offsite generating DirectAdmin backups

What is it?

This script is by far complete, but it's purpose is to generate a tarred and gzip'ed backupfile, restorable by a DirectAdmin controlpanel, but made without DirctAdmin.

Can I use it?

Sure, but if you do, I assume you have a backupserver with partly rsync'd copies of several directadmin servers. The more the marrier.

Why would I?

Why would you want to generate a DirectAdmin compatible backup if the controlpanel itself is already capable enough to do this?

Well, if you can't think of a reason, let's name a few:

Should I use it?

At your own risk? Sure! Give it a shot, but make sure you understand exactly what it does and know that besides two trivial parameter checks, this script checks nothing. I repeat NOTHING. You'd be stupid to run this as root, even though I do...

YOU'RE ON YOUR OWN!

P.S. It would be great if others (with more knowledge of the DA backup internals) would join in.

Who When What Version
SysDev 2017-04-18 Added trick to get db user/pw privs by importing the 'db' and 'user' tables of the mysql dump temporary in a local mysql server, query stuff to get the data. Requires an empty 'recover' db, 'recover' user, location of mysql dumps and... hmm.. what.... 0.0.4
SysDev 2017-04-17 Added requirement mysql-server n.v.t
SysDev 2017-04-16 Added logging, reseller parameter, extra checks 0.0.3
SysDev 2017-04-15 minor changes, moved stuff to functions 0.0.2
SysDev 2017-04-10 Initial submit 0.0.1