mattock / automatic-cloud-backup

19 stars 19 forks source link

RUNBACKUP_URL not found #12

Open ilienert opened 7 years ago

ilienert commented 7 years ago

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!

bwegman commented 7 years ago

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

ilienert commented 7 years ago

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?

bwegman commented 7 years ago

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.

ilienert commented 7 years ago

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

mattock commented 7 years ago

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

bwegman commented 7 years ago

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