Datei von URL mit Benutzername- und Passwort-Abfrage automatisiert abspeichern
Hallo zusammen,
folgende Ausgangssituation:
Es wird jede Nacht um 3 Uhr ein dump erzeugt, welcher per HTTP heruntergeladen werden soll. Beispiel-URL: http://example.development.com/dumps/latest.dump
Das Ganze ist mit Benutzernamen und Passwort geschützt.
Diesen dump würde ich gerne einmal täglich automatisiert herunterladen und auf einem Netzlaufwerk abspeichern.
Des Weiteren soll immer ein aktueller Dump und der des Vortages verfügbar sein, alles andere am besten automatisiert gelöscht.
Hat jemand eine Idee, wie man das am besten realisieren kann?
Besten Dank & Gruß,
Nils
folgende Ausgangssituation:
Es wird jede Nacht um 3 Uhr ein dump erzeugt, welcher per HTTP heruntergeladen werden soll. Beispiel-URL: http://example.development.com/dumps/latest.dump
Das Ganze ist mit Benutzernamen und Passwort geschützt.
Diesen dump würde ich gerne einmal täglich automatisiert herunterladen und auf einem Netzlaufwerk abspeichern.
Des Weiteren soll immer ein aktueller Dump und der des Vortages verfügbar sein, alles andere am besten automatisiert gelöscht.
Hat jemand eine Idee, wie man das am besten realisieren kann?
Besten Dank & Gruß,
Nils
Bitte markiere auch die Kommentare, die zur Lösung des Beitrags beigetragen haben
Content-ID: 176564
Url: https://administrator.de/forum/datei-von-url-mit-benutzername-und-passwort-abfrage-automatisiert-abspeichern-176564.html
Ausgedruckt am: 16.05.2025 um 17:05 Uhr
10 Kommentare
Neuester Kommentar
Moin.
Dann gehts vieleicht damit http://gnuwin32.sourceforge.net/packages/wget.htm ?
Habe ich aber noch nie probiert...
HTH
MK
Dann gehts vieleicht damit http://gnuwin32.sourceforge.net/packages/wget.htm ?
Habe ich aber noch nie probiert...
HTH
MK

moin,
wie geschrieben wget
und am ende kommt ein move datei.suffix archiv.suffix dazu, dann hast du zur aktuellen noch genau eine alte Version.
Gruß
wie geschrieben wget
und am ende kommt ein move datei.suffix archiv.suffix dazu, dann hast du zur aktuellen noch genau eine alte Version.
Gruß
Moin.
"...
-nc
--no-clobber
If a file is downloaded more than once in the same directory, Wget's behavior depends on a few options,
including -nc. In certain cases, the local file will be clobbered, or overwritten, upon repeated download.
In other cases it will be preserved.
When running Wget without -N, -nc, or -r, downloading the same file in the same directory will result in the
original copy of file being preserved and the second copy being named file.1. If that file is downloaded
yet again, the third copy will be named file.2, and so on. When -nc is specified, this behavior is sup-
pressed, and Wget will refuse to download newer copies of file. Therefore, ``"no-clobber"'' is actually a
misnomer in this mode---it's not clobbering that's prevented (as the numeric suffixes were already
preventing clobbering), but rather the multiple version saving that's prevented.
When running Wget with -r, but without -N or -nc, re-downloading a file will result in the new copy simply
overwriting the old. Adding -nc will prevent this behavior, instead causing the original version to be pre-
served and any newer copies on the server to be ignored.
When running Wget with -N, with or without -r, the decision as to whether or not to download a newer copy of
a file depends on the local and remote timestamp and size of the file. -nc may not be specified at the same
time as -N."
Also sollte wget -r http://www.wasweissich.de/datei.name helfen. Ohne -N oder -nc.
HTH
MK
"...
-nc
--no-clobber
If a file is downloaded more than once in the same directory, Wget's behavior depends on a few options,
including -nc. In certain cases, the local file will be clobbered, or overwritten, upon repeated download.
In other cases it will be preserved.
When running Wget without -N, -nc, or -r, downloading the same file in the same directory will result in the
original copy of file being preserved and the second copy being named file.1. If that file is downloaded
yet again, the third copy will be named file.2, and so on. When -nc is specified, this behavior is sup-
pressed, and Wget will refuse to download newer copies of file. Therefore, ``"no-clobber"'' is actually a
misnomer in this mode---it's not clobbering that's prevented (as the numeric suffixes were already
preventing clobbering), but rather the multiple version saving that's prevented.
When running Wget with -r, but without -N or -nc, re-downloading a file will result in the new copy simply
overwriting the old. Adding -nc will prevent this behavior, instead causing the original version to be pre-
served and any newer copies on the server to be ignored.
When running Wget with -N, with or without -r, the decision as to whether or not to download a newer copy of
a file depends on the local and remote timestamp and size of the file. -nc may not be specified at the same
time as -N."
Also sollte wget -r http://www.wasweissich.de/datei.name helfen. Ohne -N oder -nc.
HTH
MK

moin,
ganz hybsch, aber schau dir mal Zeile 23 genauer an..Ich sag nur die iluminaten waren es diesmal nicht...
dann sowas, wie
Dann kommt es auch immer drauf an, welche Version vom WinWget du da nimmst...
Und abschliessend - warum soviele Zeilen, wenn das Passwort eh in der Batch steht, mußt du doch keine WGETRC bauen, wo das dann nochmal drin steht...
Gruß
ganz hybsch, aber schau dir mal Zeile 23 genauer an..Ich sag nur die iluminaten waren es diesmal nicht...
dann sowas, wie
echo recursive = off >>%WGETRC%
ist unhybsch...und Leerzeichen sollten einem immer eine Lehre sein...echo recursive = off>>%WGETRC%
Dann kommt es auch immer drauf an, welche Version vom WinWget du da nimmst...
Und abschliessend - warum soviele Zeilen, wenn das Passwort eh in der Batch steht, mußt du doch keine WGETRC bauen, wo das dann nochmal drin steht...
call wget.exe -N --no-cache http_user = user@domain.de http_passwd = xxxxxx http://wasweissichcom/dumps/latest.dump
Gruß