# Launcher运行应用程序时尝试备份出现错误

**URL:** https://meta.discourse.org/t/launcher-run-app-gives-error-when-trying-backup/346553
**Category:** Self-hosting
**Tags:** backups
**Created:** [2025年一月10日 18:39 UTC](https://meta.discourse.org/t/launcher-run-app-gives-error-when-trying-backup/346553 "2025-01-10T18:39:36Z")
**Posts on this page:** 1
**Showing post:** 3

<div class="post-metadata">

### Author: ![supermathie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/supermathie/32/507518_2.png) [@supermathie](https://meta.discourse.org/u/supermathie)
#### Post date: [2025年一月10日 19:48 UTC](https://meta.discourse.org/t/launcher-run-app-gives-error-when-trying-backup/346553/3 "2025-01-10T19:48:53Z")

</div>

> [@Jagster](#):
>
> 这只会给我带来错误，启动 Redis。

您是指连接到 Redis 吗？您看到的具体错误是什么？

`launcher run app` 在新的容器上下文中运行命令，因此 Redis 不会运行。这只有在 Redis 是外部运行时才有效。

以下命令应该可以工作，因为它在现有容器的上下文中运行：

```plaintext
docker exec -i app rails c <<'BackupRestore::Backuper.new(Discourse.system_user.id, with_uploads: false).run'

```

> [@Jagster](#):
>
> 而且我实际上想做的是只获取数据库转储

为什么您要执行上述操作，而不是执行更简单的 `discourse backup --sql-only`？

> [@Jagster](#):
>
> 在这样的地方我可以将其移至 S3

如果您愿意，您也可以直接告诉 Discourse 将 S3 用作备份位置。

---

_[View the full topic](https://meta.discourse.org/t/launcher-run-app-gives-error-when-trying-backup/346553)._
