Monitoring backup process

ludolugo

Verified User
Joined
Jul 24, 2019
Messages
9
Hi,
I`m using the api to monitor the backups process on several servers, the problem is that once the process is finished the json file generated doesn't say anything about the completion of all backups or errors that might have happened to the backup, while the process is being executed i can monitor the percentage completed but when finished i can't know if an user was not backed up unless y check the messages log history.
Do you know a way to get that info when finished through the API?
 
Last edited:
SSE STREAM

Although the older JS method of calling browser function still works for this, we've added support for proper SSE streaming. To make use of the new streaming syntax, simply include type=sse in the stream request, eg:
CMD_ADMIN_BACKUP?action=monitor&pid=555&get=tracking_data&type=sse

The start of each stream will begin the line with "data: " The next part will be {} json data, followed by 2 newline characters. More/immediate data: lines could follow at any time, even in the same packet. DA does assemble all sections into one data packet, when possible.

Possible data variables:

finished: 0|1 #always sent
percent: 0.00-100.00 #do not assume 100 means the stream is done. There are a few steps which will jump around.
dynamic_text: <some text>
dynamic_details: <some text>



https://directadmin.com/features.php?id=2579



Here is my output using the API via Curl:


data: { "finished": "0", "percent": "88.66"}

data: { "filesize": "480180", "filesize_readable": "469 KB", "finished": "0"}

data: { "dynamic_details": "", "dynamic_text": "Backup Complete", "finished": "1", "percent": "100"}


This was the command I used (sensitive details redacted, of course) for PID 7013:

Code:
curl --request POST --user 'admin:password' --data 'action=monitor&pid=7013&get=tracking_data&type=sse' -k https://IP.IP.IP.IP:2222/CMD_ADMIN_BACKUP

So, you could try parsing the output for these: "dynamic_text": "Backup Complete", "finished": "1",
 
SSE STREAM

Although the older JS method of calling browser function still works for this, we've added support for proper SSE streaming. To make use of the new streaming syntax, simply include type=sse in the stream request, eg:
CMD_ADMIN_BACKUP?action=monitor&pid=555&get=tracking_data&type=sse

I was late seeing this post. What I don't understand is, how can you determine the backup pid for the current backup progress when you call it from the terminal or API. I can only see the matching ID for one of multiple running of dataskq processes. I have the same question about backup restoration too.
 
Back
Top