Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to trigger Jira Backup Manager via Powershell -> keep getting 412

Christian Schneider
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 8, 2024

Dear community,

I had a very close look at this: atlassianlabs / automatic-cloud-backup — Bitbucket

I have created my own script, that successfully triggers the Confluence Backup Manager and then unsuccessfully triggers the Jira Backup Manager.

 

My script calls the Jira-Backup-Endpoint like this:


$urlBackupStatus = "https://$domain/rest/backup/1/export/getProgress?taskId=$initiateBackupTaskId"

#Set body $body = @{ cbAttachments=$attachments exportToCloud=$cloud } $bodyjson = $body | ConvertTo-Json


$headers = @{ "Authorization" = "Basic $auth" "Content-Type" = "application/json" "Accept" = "application/json" }



try {     $initiateBackup = Invoke-RestMethod -Method POST -Uri $urlBackupEndpoint -Headers $headers -Body $bodyjson -ErrorVariable errorOutput -UseBasicParsing .... [ code for checking, if creation was successfull] ... } catch { $errorMessage = $errorOutput.Message     $InitiateBackup = $_.Exception.Response.GetResponseStream()     $reader = New-Object System.IO.StreamReader($InitiateBackup)     $reader.BaseStream.Position = 0     $reader.DiscardBufferedData()     $jsonErrorMessage2 = $reader.ReadToEnd() | ConvertFrom-Json     $errorMessage2 = $jsonErrorMessage2.error }
No matter how long I wait for the next run of the script, it always jumps to the catch and gives me this error:
The remote server returned an error: (412) Precondition Failed. -> Backup frequency is limited. You cannot make another backup right now. Approximate time until next allowed backup: 5h 58m

 

I am not sure, if the backup is created as there are no real timestamps in any of the responses.

 

Anybody has had the same issue and solved it?

Is there an official documentation for the backup-APIs?

 

0 answers

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events