jira automated backupscript not able to download backup zip file


I was trying to use the automated backup script available from

backup script

I was able to start the backup but the download fails it give me  

HTTP/1.1 401 Unauthorized

I was able to login fine when i try manually to login to the site with the same session id

It fails to authorized only when i try to go to download page.

Any idea why it fails to authorize for download page ? 

Below is the log

DEBUG output created by Wget 1.14 on linux-gnu.


URI encoding = âUTF-8â


Stored cookie visionway.atlassian.net -1 (ANY) / <session> <secure> [expiry none] atlassian.xsrf.token BEBH-V2SM-TGGA-X6S4|25b8551fde79075db91829236ca76d6dfd0548a4|lout

Converted file name 'jira_export_20170504_114809.zip' (UTF-8) -> 'jira_export_20170504_114809.zip' (UTF-8)

--2017-05-04 11:53:54--  patht to zip file

Resolving visionway.atlassian.net (visionway.atlassian.net)...

Caching visionway.atlassian.net =>

Connecting to visionway.atlassian.net (visionway.atlassian.net)||:443... connected.

Created socket 4.

Releasing 0x00000000016569c0 (new refcount 1).

Initiating SSL handshake.

Handshake successful; connected socket 4 to SSL handle 0x000000000166b8e0


  subject: /C=US/ST=California/L=San Francisco/O=Atlassian Network Services, Inc./CN=*.atlassian.net

  issuer:  /C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert SHA2 High Assurance Server CA

X509 certificate successfully verified and matches host visionway.atlassian.net

---request begin---

GET //plugins/servlet/ondemandbackupmanager/download/2233fabb-61de-4260-a4f8-414387469b44/jira_export_20170504_114809.zip HTTP/1.1

User-Agent: Wget/1.14 (linux-gnu)

Accept: */*

Host: visionway.atlassian.net

Connection: Keep-Alive

Cookie: atlassian.xsrf.token=BEBH-V2SM-TGGA-X6S4|25b8551fde79075db91829236ca76d6dfd0548a4|lout

 ---request end---

HTTP request sent, awaiting response...

---response begin---

HTTP/1.1 401 Unauthorized

1 answer

You need to do it in a two step rocket..

One wget will authenticate and return the cookie. Next request will download the file, but with the cookie file received from the first call. 


Example here:


Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Monday in Jira

Meet the Jira Software 8.0 platform release

  Hello Atlassian community!   We're excited to share the Jira Server and Data Center 8.0 platform release.  With 8.0, teams will be able to work more productively and sca...

787 views 15 12
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you