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

I occasionally have need to download a backup from an instance where I can’t ssh. Pulling 2GB down over my home internet connection where speedtest.net claims I get almost 500Mbps down isn’t that painful, but pushing it back up a 20Mbps is.

I thought that I might be able to use curl and pass an API key to download the backup, but what it gets is a redirect in an HTML document, and trying that URL in curl ends in a “bad request.”

Is there some way to do this that I’m missing?

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.

4 个赞

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

2 个赞

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.

2 个赞

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

4 个赞

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

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

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

1 个赞

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

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

1 个赞