Jump to content

[Beta] BackupSQL docker

Recommended Posts

I created this little docker to keep a backup of my SQL database for Kodi.

It starts from a phusion base image, installs mariaDB and then launches a cron job.

It requires a location for the backed-up files, cron parameters, IP address of the SQL server, the pushbullet token if you want notifications and the number of backup files to keep. All of these are environment variables and can be input after selecting Advanced view.


I'm using it for some time now with no issues.

Link to the docker-template is in my signature.


EDIT 1: Right now only one backup a day is supported due to the naming convention of the backup file. But then I was not expecting to need more than one backup a day.


EDIT 2: Obviously this docker needs more error proofing - I would like to change it into beta until all the fixes are in place


EDIT 3: Added variable for userid, implementing the password is giving me a little headache. Pushbullet notification modified for successful backup and to show error code if the backup command failed.


EDIT4: In order to restore a backed-up file use:

gunzip < MyDatabase_DATE.sql.gz | mysql -uroot -h



Link to comment

I love the idea of this, I set it up like this, my MySQL server is Needo's MariaDB


MySQLIP: (also tried


The job runs but creates a 1kb file.


The logs don't reveal anything and the pushbullet notification suggests the backup is completed, I suspect it's because of a username / password issue as I don't see anywhere to input this.


Also, I think it would be helpful for people like me that aren't particularly skilled with mysql to let us know how to restore the data.


Link to comment
  • 3 weeks later...

i m not sure how much a docker repo eats resource but i dont think that mysql backup needs a docker repo. plugin sounds more efficiant to me. i edit my v5 plugin files a bit to backup my kodi database on mariadb docker and add pushover notification. i dont have time for updating my plugin to v6 but i will attach my files, soana or anyone can use or develop.


- extract files to /boot/custom/

- change the parametrs in cfg file.

- add /backup path mapping to your (mysql/mariadb etc)docker repo.

- and add this to your go file:

#mysql backup cron job

* checking files permissions will be good to be sure they can be executed.


Link to comment
  • 3 months later...

I am getting the 1kb file also.  I saw where to enter the SQL_userid variable to which I entered 'root'.  What about the root password and/or db user and password?  Where how do I enter those?  Would love to get this working.  For years I used a script via cronjob to backup my Kodi db's, but now that I switched over to Docker containers I haven't been able to get anything to work.


Also, when working correctly, is this just the video database or does it also include the music database?

Link to comment
  • 4 years later...

Back from the dead.

Does this docker (or the script mentioned) work on 6.8.3?  With the docker, I am getting the 1kb file with a zero-byte sql dump file inside.


With the script, it fails to run,giving me "mysqldump: errno 11 on write" when it executes the docker command

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...