We moved this page to our Documentation Portal. You can find the latest updates here. |
Question
How can I check if a backup is still running or not?
Environment
OnApp 3.x-6.x
Answer
First, you need to get the backup ID. To do that, go to the backup log in the UI. At the top of the page, there is a line referencing the backup:
Target Backup #1204
In this case the ID is 1204. Now, get the disk identifier that the backup is running for. In the database on the control server, run:
mysql> select d.identifier,b.identifier from disks as d join backups as b on b.target_id=d.id where b.id=1204; +----------------+----------------+ | identifier | identifier | +----------------+----------------+ | pweasjoi4dux8r | utewnxzt9vfawk | +----------------+----------------+
If you're using incremental backups, you would use this query instead:
mysql> select d.identifier,b.identifier from disks as d join virtual_machines as vm on vm.id=d.virtual_machine_id join backups as b on b.target_id=vm.id where b.id=1204 and d.disk_size>1; +----------------+----------------+ | identifier | identifier | +----------------+----------------+ | pweasjoi4dux8r | utewnxzt9vfawk | +----------------+----------------+
Go to the backup server and use ps to find the backup:
[root@120.0.0.1 ~]# ps ax|grep utewnxzt9vfawk 18187 pts/2 Ds+ 0:01 tar -C /mnt/onapp-backup-utewnxzt9vfawk --sparse --one-file-system -zcp -f /onapp/backups/h/w/utewnxzt9vfawk --numeric-owner --xattrs . 18861 pts/4 S+ 0:00 grep utewnxzt9vfawk [root@120.0.0.1 ~]#
According to ps, the backup still has a running process. To see, if there is still activity with the backup, you can run:
[root@120.0.0.1 ~]# strace -p 18187
You should see output scrolling, referencing reading and writing that indicates that the backup is still running.
Otherwise, if no output is scrolling, then the backup is zombie and can be canceled.