When a user triggers a system import or export as described here, what they will end up seeing in their browser is a loading circle. Should they remain on that page, the loading circle will remain until the job is complete, in which case a notification will appear in the UI indicating that the job is completed successfully.
However, should the user exit out of the page, the job will continue to run in the background while the loading circle will disappear. The user will even be able to navigate back to the import/export page and trigger a new job.
For users who are performing large imports or exports, it is often not feasible to leave the page open, or it might be easy to navigate away from the page or accidentally close out of it. Thus, we need a way to be able to monitor the import/export job to ensure that it is actually running and when it has completed.
This can be achieved by using the background tasks REST API call, which requires an admin user.
curl -u admin:<password> http:/<Artifactory URL>/artifactory/api/tasks -o tasks.json
The REST API call above gets the full list of running background tasks as a list of JSON objects and saves it to a file.
Once you have this tasks.json file on hand, you can open it in a text editor and search for either “Import” or “Export”, depending on the job you are running. If the job is still running, you will encounter a JSON object that appears similar to the below.
{
"id" : "artifactory.ExportJob#ae103c87-53f2-485c-b56f-0a580caafe1e",
"type" : "org.artifactory.repo.service.ExportJob",
"state" : "running",
"description" : "Export Repository - FULL (manual trigger)",
"started" : "2022-05-31T19:03:35.718Z"
}
If all import and export jobs are complete, you will not find any results in the search.
To double check that your system import or export is complete, look for the following lines, which differ based on the job, in your artifactory-service.log.