# \`curl\` 또는 \`wget\`로 백업 다운로드

**URL:** https://meta.discourse.org/t/download-backup-with-curl-or-wget/135203
**Category:** Self-hosting
**Tags:** backups
**Created:** [12월 5, 2019, 7:27오후 UTC](https://meta.discourse.org/t/download-backup-with-curl-or-wget/135203 "2019-12-05T19:27:07Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [12월 5, 2019, 7:27오후 UTC](https://meta.discourse.org/t/download-backup-with-curl-or-wget/135203/1 "2019-12-05T19:27:07Z")

</div>

가끔 `ssh` 접속이 불가능한 인스턴스에서 백업 파일을 다운로드해야 할 때가 있습니다. 속도 테스트에서 다운로드 속도가 거의 500Mbps에 달한다고 나오는 가정용 인터넷 연결로 2GB를 받아오는 것은 그다지 고통스럽지 않지만, 20Mbps 업로드 속도로 다시 올리는 것은 꽤 힘들죠.

`curl`을 사용해 API 키를 전달함으로써 백업을 다운로드할 수 있을 것 같았지만, 실제로는 HTML 문서 형식의 리디렉션을 받게 되었고, 해당 URL을 curl로 시도하면 “bad request” 오류가 발생합니다.

제가 놓치고 있는 어떤 방법이 있을까요?

---

<div class="post-metadata">

### Author: ![michaeld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/michaeld/32/1594_2.png) [@michaeld](https://meta.discourse.org/u/michaeld)
#### Post date: [12월 5, 2019, 7:46오후 UTC](https://meta.discourse.org/t/download-backup-with-curl-or-wget/135203/2 "2019-12-05T19:46:23Z")

</div>

네, 익숙한 이야기네요. 몇 년 전에 [이것](https://meta.discourse.org/t/download-backup-email-link-only/59626/11)을 만들었거든요. 한동안 사용하지 않아서 수정 없이 여전히 작동하는지 확실하지 않아요.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [12월 5, 2019, 7:50오후 UTC](https://meta.discourse.org/t/download-backup-with-curl-or-wget/135203/3 "2019-12-05T19:50:14Z")

</div>

와! 내 꿈(아마도)이 응답해준 것 같아! 마이클, 고마워. 좀 더 열심히 검색해봤어야 했는데.

---

<div class="post-metadata">

### Author: ![Stephen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephen/32/95011_2.png) [@Stephen](https://meta.discourse.org/u/Stephen)
#### Post date: [12월 5, 2019, 7:51오후 UTC](https://meta.discourse.org/t/download-backup-with-curl-or-wget/135203/4 "2019-12-05T19:51:10Z")

</div>

왜 [SCP](https://linux.die.net/man/1/scp)를 이용해 서버 간 전송을 하지 않나요?

SSH를 사용하며 로컬 라인을 거치지 않는 전송을 허용하고, 모든 호스트에 이미 설치되어 있습니다.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [12월 5, 2019, 7:53오후 UTC](https://meta.discourse.org/t/download-backup-with-curl-or-wget/135203/5 "2019-12-05T19:53:33Z")

</div>

> [@Stephen](#):
>
> 왜 [SCP](https://linux.die.net/man/1/scp)로 서버에서 서버로 직접 전송하지 않나요?

> [@pfaffman](#):
>
> 가끔 `ssh` 접속이 불가능한 인스턴스에서 백업을 다운로드해야 할 때가 있습니다.

관리자 권한은 있지만 SSH/SCP 접근 권한이 없는 Discourse 인스턴스가 세상에 존재합니다. 😉

---

<div class="post-metadata">

### Author: ![Isambard](https://avatars.discourse-cdn.com/v4/letter/i/858c86/32.png) [@Isambard](https://meta.discourse.org/u/Isambard)
#### Post date: [6월 20, 2024, 4:24오후 UTC](https://meta.discourse.org/t/download-backup-with-curl-or-wget/135203/6 "2024-06-20T16:24:16Z")

</div>

저도 다른 머신에서 백업을 가져오려다 같은 문제를 겪었습니다(제 머신이 아니므로 SSH 접근 권한이 없었죠). 더 복잡했던 점은 Brevo를 이메일 제공자로 사용하고 있는데, 이 회사가 추적(tracking)을 위해 링크를 자체 서버로 리다이렉트하도록 변경한다는 것이었습니다.

백업 관련 이메일에서는 이메일 제공자가 덮어쓸 수 있는 a href에 토큰을 숨기는 대신, 전체 URL과 토큰을 명시적으로 표시하는 것이 유용할 수 있습니다.

---

<div class="post-metadata">

### Author: ![michaeld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/michaeld/32/1594_2.png) [@michaeld](https://meta.discourse.org/u/michaeld)
#### Post date: [6월 20, 2024, 4:35오후 UTC](https://meta.discourse.org/t/download-backup-with-curl-or-wget/135203/7 "2024-06-20T16:35:35Z")

</div>

로그인을 하지 않으면 링크도 작동하지 않습니다.

---

<div class="post-metadata">

### Author: ![Isambard](https://avatars.discourse-cdn.com/v4/letter/i/858c86/32.png) [@Isambard](https://meta.discourse.org/u/Isambard)
#### Post date: [6월 20, 2024, 4:54오후 UTC](https://meta.discourse.org/t/download-backup-with-curl-or-wget/135203/8 "2024-06-20T16:54:33Z")

</div>

백업 파일을 wget로 다운로드하기 전에 원격 머신의 커맨드라인을 통해 '로그인’하는 간단한 방법이 있을까요?

---

<div class="post-metadata">

### Author: ![michaeld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/michaeld/32/1594_2.png) [@michaeld](https://meta.discourse.org/u/michaeld)
#### Post date: [6월 20, 2024, 5:11오후 UTC](https://meta.discourse.org/t/download-backup-with-curl-or-wget/135203/9 "2024-06-20T17:11:47Z")

</div>

두 번째 게시물에 있는 제 스크립트를 사용해 보셨나요?
