Any ways to check percona xtrabackup backup process is running in mysql DB

I need to check percona xtrabackup backup command is running in mysql db? anyways?

reason is: I am creating a script which need to check already running backup process in mysql db and if it is running, should terminate new backup request.

Hi @shrishail

You can run ps command on linux:

ps -ef | grep xtrabackup

Hi @Marcelo_Altmann , Thanks for the response.

Yes, I thought the same.
Anyways to check inside the db?
I don’t think even its feasible to check in DB as xtrabackup is copying the db files and not doing any operation on DB. Isn’t it?

We do take LOCK INSTANCE/TABLE FOR BACKUP, which is a metada lock, so you can potentially check if there is such lock by querying metadata_locks table from performance_schema.

1 Like

Another option, if you have a dedicated user for your backup, you can check if that user is connected, xtrabackup will establish a connection at the start of the backup and only close once backup has been completed.

1 Like