Question
How can I check if a backup is still running or not?
Environment
OnApp 3.x-6.x
Answer
To check it:
- In the UI, find the backup ID via Control Panel > Admin > Logs menu. For example, the ID is 1204.
On the Control Panel server, on the database, 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 | +----------------+----------------+
CODE
In case of incremental backups, use the following 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 |
select d.identifier as disk_identifier,b.identifier as backup_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;
CODE
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 ~]#
CODE
According to ps
, the backup still has a running process. To see, if there is any activity with the backup, run:
[root@120.0.0.1 ~]# strace -p 18187
CODE
If you need to scroll the output, it indicates that the backup is still running. Otherwise, the backup is a zombie and can be canceled.