# 备份存储到s3，但仍然存一些随机的本地备份

**URL:** <https://meta.discourse.org/t/backups-go-to-s3-but-still-a-few-random-local-backups-stored/314903>\
**Category:** Self-hosting\
**Tags:** backups\
**Created:** [2024年七月4日 00:53 UTC](https://meta.discourse.org/t/backups-go-to-s3-but-still-a-few-random-local-backups-stored/314903 "2024-07-04T00:53:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rahim123](https://avatars.discourse-cdn.com/v4/letter/r/df705f/32.png) [@rahim123](https://meta.discourse.org/u/rahim123)\
**Post date:** [2024年七月4日 00:53 UTC](https://meta.discourse.org/t/backups-go-to-s3-but-still-a-few-random-local-backups-stored/314903/1 "2024-07-04T00:53:13Z")

</div>

您好，我检查了磁盘空间，发现在 `/var/discourse/shared/standalone/backups/default/` 目录下有大量数据，尽管我的备份已配置为使用 S3。

```plaintext
3.6G Sep 15 2023 forum-com-2023-09-15-060642-v20230910021213.tar.gz
3.6G Sep 23 2023 forum-com-2023-09-23-060044-v20230910021213.tar.gz
3.7G Oct 7 2023 forum-com-2023-10-07-060258-v20230910021213.tar.gz
4.6G Mar 1 01:07 forum-com-2024-03-01-060255-v20240122015630.tar.gz
5.1G May 31 01:09 forum-com-2024-05-31-060527-v20240307231053.tar.gz

```

这些是备份失败了吗？

> [@If backup to s3 upload fails, backup is stored locally but ignores the backup limit](https://meta.discourse.org/t/if-backup-to-s3-upload-fails-backup-is-stored-locally-but-ignores-the-backup-limit/188231):
>
> Multipart upload backups to Scaleway S3 aren’t working for me still. [Backup Upload to S3 Fails on scaleway (multipart upload)](https://meta.discourse.org/t/backup-upload-to-s3-fails-on-scaleway-multipart-upload/177764) The problem is, if the upload fails, the backup remains stored locally like when doing normal local backups. Which is good. However the backup limit is ignored, so it will keep filling up the local disk indefinitely with backups until it causes downtime. This is on 2.6.4 stable.

如果是这样，根据我设置的 `maximum backups`（最多 15 个备份）策略，它们应该被自动删除。或者是因为我没有设置 `remove older backups`（删除旧备份）？

无论如何，我可以手动删除它们，对吗？

---

<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:** [2024年七月4日 09:52 UTC](https://meta.discourse.org/t/backups-go-to-s3-but-still-a-few-random-local-backups-stored/314903/2 "2024-07-04T09:52:43Z")

</div>

这是一个长期存在的错误。我一直无法弄清楚是什么原因造成的。它很少发生，所以很难诊断。解决方法是删除本地备份。

---

<div class="post-metadata">

**Author:** ![omarfilip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/omarfilip/32/208019_2.png) [@omarfilip](https://meta.discourse.org/u/omarfilip)\
**Post date:** [2024年八月10日 17:42 UTC](https://meta.discourse.org/t/backups-go-to-s3-but-still-a-few-random-local-backups-stored/314903/3 "2024-08-10T17:42:36Z")

</div>

尝试更改备份时间。

> [@Local backups not deleted after they are uploaded to Amazon S3](https://meta.discourse.org/t/local-backups-not-deleted-after-they-are-uploaded-to-amazon-s3/247371/13?u=omarfilip):
>
> Sixteen days later, it seems like this was the solution—no more undeleted backups. I don’t know what was causing the conflict, but it’s moot now.
