使用 `curl` 或 `wget` 下载备份

我偶尔需要从无法通过 ssh 访问的实例下载备份。通过家庭互联网连接下载 2GB 数据并不算太痛苦,尽管 speedtest.net 显示我的下行速度接近 500Mbps,但将其上传到仅 20Mbps 的上行带宽则非常耗时。

我曾考虑使用 curl 并传递 API 密钥来下载备份,但获取到的却是 HTML 文档中的重定向信息,尝试用 curl 访问该 URL 时则会返回“错误请求”。

是否有我遗漏的方法可以实现这一操作?

Yeah, sounds familiar. I made this a few years ago. Haven’t used it in a while though so I’m not sure if it still works without modifications.

Wow! My dreams (maybe) answered! Thanks, Michael. I guess I should have searched a bit harder.

Why not just SCP server to server?

It uses SSH, will allow transfers that don’t hit your local line, and is already present on every host.

There exist Discourse instances on the planet where I have admin access, but not SSH/SCP access. :wink:

我也遇到了同样的问题,试图从一台非我自己的机器(因此没有 SSH 访问权限)上拉取备份。由于我使用 Brevo 作为电子邮件提供商,他们会篡改链接以重定向到他们自己的服务器进行跟踪,这使得问题更加复杂。

对于备份电子邮件,最好明确显示完整的 URL 和令牌,而不是将其隐藏在 a href 中,因为电子邮件提供商可能会覆盖它。

您仍然需要登录,否则链接将无法正常工作。

有没有一种简单的方法可以在远程机器的命令行上“登录”,然后再发出 wget 来下载备份?

你试过我第二个帖子里的脚本吗?