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?