1

I need to do an automatisation of the backup of our MariaDB service from an Linux Ubuntu server.

The connexion to the service must pass through the cloud foundry service connector which create a secured tunnel.

For example : cf service-connector 13000 10.0.20.18:3306

My problem is that this command is blocking the command line, so I don’t know how to launch this command AND then connecting to the database. I have tried to run the command in background with ‘nohup’ without success.

Is there a solution for automatic connexion to the mariaDB service ?

Thank you,

Romain

  • 1
    Alternatively, you can trigger MariaDB backups using the HTTP API: http://stackoverflow.com/questions/39655921/mariadb-backup-from-the-command-line – Matthias Winzeler Jan 17 '17 at 16:31
  • I posted an answer here, but I will repeat: the safest and final solution to make a mariadb backup (in an automated manner) is to use [cf-mariadb-backup-plugin](https://github.com/gsmachado/cf-mariadb-backup-plugin). I'm using it on production. – gsmachado Jan 19 '17 at 00:25
  • Please indicate that as of Oct 2017 service-connector isn't available anymore. So this solution won't work. – LBA Oct 15 '17 at 22:40

3 Answers3

5

You can execute a task in the background in bash scripting so you should be able to just add a & to the end of your command so it's not blocking anymore.

cf service-connector 13000 10.0.20.18:3306 &

cloudlena
  • 865
  • 11
  • 14
1

Hello Romain Schlick

This is the solution to automate backups of MariaDB in Swisscom AppCloud, through a command line: https://github.com/gsmachado/cf-mariadb-backup-plugin

I'm the developer of cf-mariadb-backup-plugin and I developed it exactly because I needed a tool to automate that.

Also, I'm using it on production for some services, and it's running smoothly.

Community
  • 1
  • 1
gsmachado
  • 197
  • 8
-2

I was tried with 'nohup' only without the '&'. It's working with &.

Thank you

  • 1
    for future: please post that in the comment section of @mastertinner answer and accept his answer as "approved" / upvote his answer. – Sybil Jan 17 '17 at 19:31