How to start the nightly database backup manually?


#1

Hi there,
I would like to manually start the built in nightly database backup which happens in the cleanup window. Is a manual start of the database backup with a command possible, so that I could use it for scripting?
Thanks in advance for some hints!


#2

Meanwhile I looked further for a hint on this but I was not successful at all. Perhaps the urbackup-server-web-api-wrapper may have such a functionality included? However, I am looking forward for some hints.


#3

I’m surprised no-one responded to you yet, but this is the script I run to backup and then cleanup…

#!/bin/bash

service urbackupsrv stop

urbackupclientctl start -f

urbackupsrv cleanup --amount 0%

service urbackupsrv start


#4

I’d advise to use another method to backup those files if you want to do more advanced stuff with it. For example by installing the client itself on the server and running backups with that (with snapshots of course).


#5

The client is running on the server, and it backs up to another urbackup server. You can’t run backups when the database is running and being modified can you? I don’t trust that. So i just shutdown 1 server occasionally and back it up to the other and alternate from the 2nd to the first, so no downtime


#6

Hi uroni and jayrehme,
thanks for your input.
I also wonder how to get a consistent backup of Urbackup database (located in /var/urbackup) on the operation system disk (LVM2) and the backup storage located on a separate volume which is also a LVM2 device. So, getting LVM snapshots is easy but how could I force the Urbackup client to make two snapshots at the exact same time and subsequently back them up?