Backup mit `curl` oder `wget` herunterladen

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 „Gefällt mir“

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

2 „Gefällt mir“

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 „Gefällt mir“

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

4 „Gefällt mir“

Ich hatte gerade dasselbe Problem, als ich versuchte, ein Backup von einem Rechner zu ziehen, der nicht meiner war (also kein SSH-Zugriff). Es wurde noch komplizierter, da ich Brevo als E-Mail-Anbieter nutze und sie den Link manipulieren, um ihn für Tracking-Zwecke auf ihren eigenen Server umzuleiten.

Für die Backup-E-Mails könnte es nützlich sein, die vollständige URL und das Token explizit anzuzeigen, anstatt sie im a href zu verstecken, was von E-Mail-Anbietern überschrieben werden kann.

Sie müssen sich trotzdem anmelden, sonst funktioniert der Link auch nicht.

1 „Gefällt mir“

Gibt es eine einfache Möglichkeit, sich über die Befehlszeile einer Remote-Maschine anzumelden, bevor Sie wget ausführen, um das Backup herunterzuladen?

Haben Sie mein Skript im zweiten Beitrag ausprobiert?

1 „Gefällt mir“