Hallo seit einiger Zeit versche ich eine lösung zu finden um auf einer Seite ein File runterzuladen das den Namen aber ständig ändert ( *x86.exe ) und das selbe auch per FTP. Per FTP ist zusätzlich das Problem das im gleichen Verzeichniss meherer *x86.exe Files sind aber nur das Neueste runtergeladen werden sollte. Bin für Tips dankbar. gruss Manfred
Hallo, at Mon, 10 Jun 2002 17:55:00 +0200 Manfred Hungerland wrote:
Hallo
seit einiger Zeit versche ich eine lösung zu finden um auf einer Seite ein File runterzuladen das den Namen aber ständig ändert ( *x86.exe ) und das selbe auch per FTP.
wget ist Dein Freund. Infos erhälst Du unter man wget. Gruß Michael -- Buy a Pentium III so you can reboot faster. Registered Linux User #228306 ICQ #151172379 http://counter.li.org GNU GPG-Key ID 0140F88B
On 10 Jun 2002 at 18:01, Michael Raab wrote:
Hallo,
at Mon, 10 Jun 2002 17:55:00 +0200 Manfred Hungerland wrote:
Hallo
seit einiger Zeit versche ich eine lösung zu finden um auf einer Seite ein File runterzuladen das den Namen aber ständig ändert ( *x86.exe ) und das selbe auch per FTP.
wget ist Dein Freund. Infos erhälst Du unter man wget.
Gruß Michael
Hi div. Versuche mit wget habe ich schon durchgeführt. Das Problem ist aber ich kenne den Filenamen nicht genau. Das heisst wenn 3 Files z.B. 123x86.exe, 134x86.exe und 234x86.exe möglich sind, ich aber nur 234x86.exe möchte habe ich ein Problem nur mit wget. Daher wäre ein Script von nutzen. Meine versuche waren auch schon dahingehend. w3m www.symantec.com/avcenter/download/pages/DE-N95.html
/tmp/www.symantec.html x86=$(grep x86 /tmp/www.symantec.html) #virdef=$(cut -f2 x86 ) #wget -N --proxy=off /pub/test/ ftp://ftp.symantec.com/public/english_us_canada/antivirus_definitions/norton_antivir us/x86
Leider sind hier noch ein paar fehler enthalten Das Ergebnis von grep ist korekt aber ich erhalte zusätzlich zum Filenamen noch weitere Infos die ich nicht löschen kann. 0610x86.exe Juni 10 Juni 10 6.06 MB habe das auch schon mit cut versucht leider ohne Erfolg Gruss Manfred
Hallo Manfred, Am Mon, 2002-06-10 um 20.11 schrieb Manfred Hungerland:
On 10 Jun 2002 at 18:01, Michael Raab wrote:
Hallo,
at Mon, 10 Jun 2002 17:55:00 +0200 Manfred Hungerland wrote:
Hallo
seit einiger Zeit versche ich eine lösung zu finden um auf einer Seite ein File runterzuladen das den Namen aber ständig ändert ( *x86.exe ) und das selbe auch per FTP.
wget ist Dein Freund. Infos erhälst Du unter man wget.
div. Versuche mit wget habe ich schon durchgeführt. Das Problem ist aber ich kenne den Filenamen nicht genau. Das heisst wenn 3 Files z.B. 123x86.exe, 134x86.exe und 234x86.exe möglich sind, ich aber nur 234x86.exe möchte habe ich ein Problem nur mit wget. Daher wäre ein Script von nutzen.
Ist auch einfach zu machen, da sich im Dateinamen das Datum verbirgt. Zuerst kommt der Monat und danach der Tag, also folgendes Muster: mmddx86.exe Habe das ganze in das folgende kleine Perl Script gepackt, das mit leichten Modifikationen auch bei dir laufen sollten. <SCRIPT> #!/usr/bin/perl use strict; use DB_File; use vars qw( $ua %h $file $request $response $k $v $d @d $i ); use vars qw( $mday $mon $year $updatefile ); require LWP::UserAgent; $ua = new LWP::UserAgent; $ua->proxy(http => 'http://proxy:3128'); tie %h, "DB_File", "status.db", O_RDWR|O_CREAT, 0777, $DB_HASH ; sub resetdate { $h{"n16"} = "0601"; $h{"i32"} = "0601"; $h{"x86"} = "0601"; } # resetdate nur das allererste Mal mit aufrufen, danach auskommentieren &resetdate(); sub getnewdate { my $i = @_[0]; my $fullday = 86400; @d = localtime(time() - ($fullday * $i)); my $mday = $d[3]; my $mon = $d[4] + 1; if ($mday < 10) { $mday = "0".$mday; } if ($mon < 10) { $mon = "0".$mon; } return($mon.$mday); } foreach $k (sort keys %h) { $v = $h{$k}; print "Loop over: $k -> $v\n"; $d = &getnewdate(0); $i = 1; if ($d lt $v) { $h{$k} = "0101"; } while ($d gt $v) { $file = $d.$k.".exe"; print "Get File: $file !\n"; $request = new HTTP::Request('GET', "http://www.symantec.com/avcenter/download/us-files/$file"); $response = $ua->request($request, "$file"); if ($response->is_success) { if($k eq "i32") { system("cp $file $updatefile"); my $n; ($n,$n,$n,$mday,$mon,$year)=localtime(time()-($i-1)*86400); $mon++; $year = $year + 1900; } $h{$k} = $d; last(); } $d = &getnewdate($i); $i++; } } untie(%h); </Script> -- MfG Andreas Gern
Am Montag, 10. Juni 2002 20:11 schrieb Manfred Hungerland:
div. Versuche mit wget habe ich schon durchgeführt. Das Problem ist aber ich kenne den Filenamen nicht genau. Das heisst wenn 3 Files z.B. 123x86.exe, 134x86.exe und 234x86.exe möglich sind, ich aber nur 234x86.exe möchte habe ich ein Problem nur mit wget. Daher wäre ein Script von nutzen.
Meine versuche waren auch schon dahingehend.
w3m www.symantec.com/avcenter/download/pages/DE-N95.html
/tmp/www.symantec.html
x86=$(grep x86 /tmp/www.symantec.html) #virdef=$(cut -f2 x86 ) #wget -N --proxy=off /pub/test/ ftp://ftp.symantec.com/public/english_us_canada/antivirus_definit ions/norton_antivir us/x86
Leider sind hier noch ein paar fehler enthalten Das Ergebnis von grep ist korekt aber ich erhalte zusätzlich zum Filenamen noch weitere Infos die ich nicht löschen kann.
0610x86.exe Juni 10 6.06 MB
habe das auch schon mit cut versucht leider ohne Erfolg
Ich weiss jetzt nicht genau ob ich richtig liege, wenn ich vermute dass das Trennzeichen zwischen den Feldern ein "space" ist. Falls es so wäre könntest du den Dateinamen aus der Ausgabe von grep (mit einer Pipe an sed weitergeleitet) so isolieren: sed ``s#^\ *##'' ¦ cut -d\ -f 1 Man beachte die zwei "spaces" zwischen -d\ und -f ! Hoffe das funktioniert... ;-) Grüsse, Nicolas Rüegg
Hallo vielen Dank für die Antworten werde sie gleich Testen. Danke Gruss Manfred
Hallo, On Mon, 10 Jun 2002, Manfred Hungerland wrote:
On 10 Jun 2002 at 18:01, Michael Raab wrote: Leider sind hier noch ein paar fehler enthalten Das Ergebnis von grep ist korekt aber ich erhalte zusätzlich zum Filenamen noch weitere Infos die ich nicht löschen kann.
0610x86.exe Juni 10 Juni 10 6.06 MB
| awk '{print $1}' -dnh -- Q: Warum habe so viele Männer O-Beine? A: Unwichtiges wird eben in Klammern gesetzt. -- David Leukert im Quatsch Comedy Club
participants (5)
-
Andreas Gern
-
David Haller
-
Manfred Hungerland
-
Michael Raab
-
Nicolas Rüegg