I want to determine if the backup restoration has finished successfully from the admin_backup via script or command line.
I can execute restoration via API and there is no problem with it. In the current DirectAdmin 1.63.0, when I do restore via API or GUI, it will just add the restoration command to task.queue so the script will just exit with return success (the problem here is, the restoration process that is being executed by taskq might be failed and there is no error code that can be obtained here on restoration).
This is the text that will appear after we execute restore where it will just add this restoration process in task q, leaving the script as success return code:
If the API did not use task queue then I think this will not be the problem.
One funny way how I determine restoration has finished is, I would read the restoration command in task.queue that has the word "action=restore". If this line is empty, then I can say that restore is finished.
But with this method, I will not be able to detect if the restoration has an error. What would be the most efficient way to do this? I could not find this in the forum.
Or maybe, the question should be wording like this:
is there a way to prevent DA admin_backup restoration from being added to task.queue and just execute it right away when it is called and get the return success / failed for the restoration? The restoration might be delayed in the script but I can wait until I get the correct restoration return code / status when it is finished.
I can execute restoration via API and there is no problem with it. In the current DirectAdmin 1.63.0, when I do restore via API or GUI, it will just add the restoration command to task.queue so the script will just exit with return success (the problem here is, the restoration process that is being executed by taskq might be failed and there is no error code that can be obtained here on restoration).
This is the text that will appear after we execute restore where it will just add this restoration process in task q, leaving the script as success return code:
Code:
text=Restores added to Queue
details=You will be notified via the Message System when the process is complete
If the API did not use task queue then I think this will not be the problem.
One funny way how I determine restoration has finished is, I would read the restoration command in task.queue that has the word "action=restore". If this line is empty, then I can say that restore is finished.
But with this method, I will not be able to detect if the restoration has an error. What would be the most efficient way to do this? I could not find this in the forum.
Or maybe, the question should be wording like this:
is there a way to prevent DA admin_backup restoration from being added to task.queue and just execute it right away when it is called and get the return success / failed for the restoration? The restoration might be delayed in the script but I can wait until I get the correct restoration return code / status when it is finished.
Last edited: