automatic-cloud-backup icon indicating copy to clipboard operation
automatic-cloud-backup copied to clipboard

RUNBACKUP_URL not found

Open ilienert opened this issue 8 years ago • 6 comments

backup.sh fails to generate any backup and I receive no error messages. I drilled it down to this line:

BKPMSG=$(curl -s --cookie $COOKIE_FILE_LOCATION --header "X-Atlassian-Token: no-check" -H "X-Requested-With: XMLHttpRequest" -H "Content-Type: application/json" -X POST $RUNBACKUP_URL -d "{\"cbAttachments\":\"${ATTACHMENTS}\" }" )

The curl command seems to fail due to the fact that RUNBACKUP_URL points to a nonexistent URL. I get a "Oops, you've found a dead link" response from the server. Has the format of the URL changed recently? The script was working before, several months ago.

Thanks!

ilienert avatar Aug 07 '17 09:08 ilienert

It seems the URLs do have changed. I have created a separate fork that has the changes necessary to support the new URLs for Jira. I have not tested this for confluence.

See: https://github.com/bwegman/automatic-cloud-backup/commit/6dec2394d5e47e4ec9741219ef72a621e535d710

bwegman avatar Aug 07 '17 10:08 bwegman

Thanks for the prompt reply @bwegman. However, I have a new problem with the following line

BKPMSG=$(curl -s --cookie $COOKIE_FILE_LOCATION 'https://pitcrew.atlassian.net/rest/backup/1/export/runbackup' \ -XPOST \ -H 'DNT: 1' \ -H 'Content-Type: application/json' \ -H 'Accept: application/json, text/javascript, */*; q=0.01' \ -H 'X-Requested-With: XMLHttpRequest' \ --data-binary '{"cbAttachments":"true", "exportToCloud":"true"}' ) The result is

BKPMSG='{"message":"Client must be authenticated to access this resource.","status-code":401}'

I double checked my credentials and they look fine. Could it be because I already initiated a backup within the last day?

ilienert avatar Aug 07 '17 11:08 ilienert

Oops. That's my mistake. I used a hardcoded URL (to pitcrew.atlassian.net, our JIRA instance).

I've updated my fork to use the $RUNBACKUP_URL. If you update to the latest version on my fork it should work.

bwegman avatar Aug 07 '17 11:08 bwegman

Ah, thanks! I didn't catch that :)

ilienert avatar Aug 07 '17 12:08 ilienert

@bwegman : care to issue a PR for the URL changes?

mattock avatar Aug 08 '17 07:08 mattock

Ofcourse: https://github.com/mattock/automatic-cloud-backup/pull/13

bwegman avatar Aug 08 '17 13:08 bwegman