Download backup with `curl` or `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 curtidas

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

2 curtidas

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 curtidas

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

4 curtidas

Eu também tive esse problema ao tentar extrair um backup de uma máquina que não era a minha (sem acesso SSH). A situação foi ainda mais complicada porque uso o Brevo como provedor de e-mail e eles alteram o link para redirecionar para o próprio servidor para rastreamento.

Para os e-mails de backup, pode ser útil mostrar explicitamente o URL completo e o token em vez de escondê-los no href, que pode ser sobrescrito pelos provedores de e-mail.

Você ainda precisará fazer login, caso contrário, o link também não funcionará.

1 curtida

Existe uma maneira simples de fazer ‘login’ pela linha de comando de uma máquina remota antes de executar o wget para baixar o backup?

Você tentou meu script na segunda postagem?

1 curtida