PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : Cron dupliziert aufgerufene Datei



crash_lux
21.03.05, 09:07
Hallo und Guten Morgen ;) Ich hoffe das ich das richtige Forum erwischt habe. Also ich habe hier ein Suse 9.0 System auf dem ich einen Cronjob eingeruichtet habe der wie folgt aussieht


*/1 * * * * /usr/bin/wget http://localhost/tkanlage/weckdienst/db_abfrage_cron.php > /dev/null

Ich hatte mich schon vor kurzem gewundert wieso der Rechner so langsam geworden ist. Nun heute konnte ich feststellen das die Datei db_abfrage_cron.php zu tausende mit fortlaufender Nr. in /home/tkanlage besteht. Hat jemand einen Rat wie so etwas passieren kann ... und wie ich es abschalten kann. Danke schonmal

Gruss crash_lux

marce
21.03.05, 09:28
Naja - Du sagst ja wget, es soll die Datei runterladen. Das tut es dann auch und speichert die Datei brav im Verzeichnis. 1 min. später soll es sie nochmal runterladen, sie ist schon vorhanden, also wird sie mit einer (forlaufenden) Nummer versehen und gespeichert...

Du leitest ja nur die Konsolen-Ausgabe von wget um - entweder nimmst Du also ein Downloadprg., welches auch die Datei an die Konsole sendet (t.b. curl) oder Du sagst dem wget, wohin es die Datei speichern soll (inkl. Dateiname) - da gibt es sogar eine Option dafür. Die herauszufinden überlasse ich aber Dir. Und übrigens, das Verhalten von wget diesbezüglich ist in der man-Page beschrieben...

crash_lux
21.03.05, 10:13
Hallo, Danke für die schnelle Antwort. An das mit wget dachte ich auch, war mir bloss nicht sicher. Ok dann werde ich da mal weiter forschen.

Danke
Schönen Tag ;)
crash_lux

marce
21.03.05, 10:15
Ich hatte mich schon vor kurzem gewundert wieso der Rechner so langsam geworden ist.

nur mit "langsam" dürfte das nichts zu tun haben...

Svenny
21.03.05, 10:16
zumal müllts die logfiles zu weil wget nach stderr ausgibt.

marce
21.03.05, 10:19
... was ja egal ist - erstens sind Logausgaben immer gut zum Fehler finden und zweitens wird das ja sicherlich wegrotiert...

xstevex22
21.03.05, 11:42
aus der manpage:

[..]
--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 cer-
tain 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 suppressed, 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 preserved 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.

Note that when -nc is specified, files with the suffixes .html or
.htm will be loaded from the local disk and parsed as if they had
been retrieved from the Web.
[..]