Clone status from command line

loadedmind

New Member
Jun 23, 2014
8
0
1
Hey all. I'm trying to figure out a way to check the status of a clone from the command line instead of having to login through the web gui.
 
  1. List active tasks:
    Code:
    root@host:~# cat /var/log/pve/tasks/active
    UPID:host:12345678:90ABCDEF:FEDCBA09:vzclone:133:root@pam: 0
    UPID:host:DEADBEEF:FEEDBAC4:09876543:vzsnapshot:133:root@pam: 1 12345678 OK
    ...
  2. Identify task's "sorting character" - the last digit of the task's unique reference string. In the example above, the first task's unique references string is 12345678:90ABCDEF:FEDCBA09, and thus the sorting character is 9.
  3. Open the task's status file:
    Code:
    root@host:~# cat "/var/log/pve/tasks/9/UPID:host:12345678:90ABCDEF:FEDCBA09:vzclone:133:root@pam:"
    create full clone of mountpoint rootfs (vmdata:subvol-133-disk-0)
    
    Number of files: 443,701 (reg: 301,302, dir: 137,504, link: 4,864, special: 31)
    
    ...
    
    total size is 48,399,223,717  speedup is 1.01
    TASK OK
 
Hi,
for get the progress of last task executed:

tail -f /var/log/pve/tasks/$(cat /var/log/pve/tasks/active | grep -v OK | grep -v failed | head -1 | cut -d: -f5 | awk '{print substr($0,length,1)}')/$(cat /var/log/pve/tasks/active | grep -v OK | grep -v failed | head -1 | awk '{print $1}')
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!