# 자동 백업 모니터링

**URL:** https://meta.discourse.org/t/automatic-backup-monitoring/261122
**Category:** Self-hosting
**Created:** [4월 9, 2023, 8:42오후 UTC](https://meta.discourse.org/t/automatic-backup-monitoring/261122 "2023-04-09T20:42:24Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![Luke\_Cousins](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/luke_cousins/32/223644_2.png) [@Luke\_Cousins](https://meta.discourse.org/u/Luke_Cousins)
#### Post date: [4월 9, 2023, 8:42오후 UTC](https://meta.discourse.org/t/automatic-backup-monitoring/261122/1 "2023-04-09T20:42:24Z")

</div>

자동 백업이 구성되어 있습니다. 제가 아는 한 백업은 문제없이 실행되고 있지만, [https://healthchecks.io와](https://healthchecks.xn--io-j87j) 같은 간단한 서비스로 이를 모니터링하여 확실하게 확인하고 싶습니다.

백업이 완료되었음을 확인하기 위해 해당 API에 간단한 호출을 구성할 수 있는 방법이 있을까요? 다음과 같은 형태입니다:

```bash
curl -m 10 --retry 5 https://hc-ping.com/your-uuid-here

```

백업 전/후 완료 후크(hook)가 있는지, 있다면 이 작업을 해당 후크에 연결할 수 있을지 궁금합니다.

> **[Monitor Shell Scripts with Healthchecks.io](https://healthchecks.io/docs/bash/)**
>
> You can easily add Healthchecks.io monitoring to any shell script. Edit the script to send a heartbeat signal when it completes. Code examples using curl.

감사합니다.

---

<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: [4월 10, 2023, 6:37오전 UTC](https://meta.discourse.org/t/automatic-backup-monitoring/261122/2 "2023-04-10T06:37:42Z")

</div>

[Discourse API를 역공학 처리](https://meta.discourse.org/t/reverse-engineer-the-discourse-api/20576)하여 백업 목록을 가져온 후, 최신 백업이 무엇인지 그리고 얼마나 오랫동안 유지되고 있는지 확인하기 위해 추가 조치가 필요합니다.

백업이 실패하면 알림을 받게 됩니다.

제가 겪었던 유일한 문제는 백업이 자동화된 개인 맞춤 마케팅 OS 재시작과 같은 시간에 예약되었을 때였습니다.

---

<div class="post-metadata">

### Author: ![Jagster](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jagster/32/192154_2.png) [@Jagster](https://meta.discourse.org/u/Jagster)
#### Post date: [4월 10, 2023, 7:01오전 UTC](https://meta.discourse.org/t/automatic-backup-monitoring/261122/3 "2023-04-10T07:01:42Z")

</div>

제가 보기로는 데이터베이스의 _배경(백그라운드)_ 백업 스케줄이 있을 때 작동하는 것 같습니다. (하루에 한 번은 부족하지 않나요?) 그리고 내장된 경고 시스템이 최대 24시간까지 지연될 수 있습니다. 하지만 데이터베이스 장애로 인해 Discourse가 다운된 경우, 캐싱 때문에 사용자가 바로 이를 인지하지 못하지만, 초기 경고 시스템으로서의 역할은 할 수 있을 것입니다.

제가 완전히 틀린 걸까요? 전혀 다른가요?

---

<div class="post-metadata">

### Author: ![Luke\_Cousins](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/luke_cousins/32/223644_2.png) [@Luke\_Cousins](https://meta.discourse.org/u/Luke_Cousins)
#### Post date: [4월 10, 2023, 8:52오전 UTC](https://meta.discourse.org/t/automatic-backup-monitoring/261122/4 "2023-04-10T08:52:57Z")

</div>

감사합니다. 백업 완료 후 "훅"을 설정할 방법이 없다면, 가장 최근 백업을 찾기 위해 Discourse API를 역공학하는 것이 가장 좋은 방법일 것 같습니다. 그렇게 하면 백업이 실패했을 때 무엇을 할지 완전히 제어할 수 있거든요… 하지만 백업 후 웹 또는 셸 명령과 같은 훅을 추가할 수 있다면 그것이 이상적일 것입니다.

도움 주셔서 감사합니다 👍

---

<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: [4월 10, 2023, 4:17오후 UTC](https://meta.discourse.org/t/automatic-backup-monitoring/261122/5 "2023-04-10T16:17:43Z")

</div>

백업이 완료된 후 후크를 호출하려면 플러그인을 만들어야 할 것 같습니다.

> [@Jagster](#):
>
> 하지만 데이터베이스 장애로 인해 Discourse가 다운된 경우, 캐싱 때문에 사용자가 즉시 이를 인지하지 못하는 상황이 발생할 수 있습니다. 이런 경우 조기 경보 시스템으로 기능할 수 있습니다.

정말 Discourse가 다운되었는지 알려는 방법으로 백업 실패를 제안하고 계신 건가요?

`/srv/status`는 꽤 좋은 정보를 제공하지만, Discourse는 해당 상태에 반영되지 않는 방식으로 깨질 수도 있습니다. 데이터베이스가 손상된 경우를 알려주는 기능은 포함하고 있습니다.

---

<div class="post-metadata">

### Author: ![Jagster](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jagster/32/192154_2.png) [@Jagster](https://meta.discourse.org/u/Jagster)
#### Post date: [4월 10, 2023, 7:12오후 UTC](https://meta.discourse.org/t/automatic-backup-monitoring/261122/6 "2023-04-10T19:12:07Z")

</div>

데이터베이스를 하루 한 번보다 더 자주 백업하라는 것 외에는 다른 것을 제안하는 것이 아닙니다. 백업 오류 시 이메일 알림도 경고 신호 역할을 할 수 있을 거라고 생각했을 뿐입니다.

---

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [4월 10, 2023, 7:19오후 UTC](https://meta.discourse.org/t/automatic-backup-monitoring/261122/7 "2023-04-10T19:19:46Z")

</div>

> [@pfaffman](#):
>
> 데이터베이스가 손상된 경우를 표시합니다.

아니요, 그렇지 않습니다. rails, Redis, nginx가 설치되어 있는 한 "ok"라고 표시됩니다.

```plaintext
root@testbeta:~# service postgresql stop
root@testbeta:~# curl https://testbeta. *************.*** /srv/status && echo
ok

```

---

<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: [4월 10, 2023, 7:58오후 UTC](https://meta.discourse.org/t/automatic-backup-monitoring/261122/8 "2023-04-10T19:58:37Z")

</div>

흥미롭군. 아마도 Rails가 시작될 때 Postgres가 꺼져 있으면 서버가 기동하지 못할 수도 있겠어.
