cron

Software besorgen und anwenden
Post Reply
Message
Author
alex

cron

#1 Post by alex »

hallo,

ich hab mir ein cron-script eingerichtet, welches ein anderes script aufruft um die aktuelle uhrzeit aus dem netz zu holen. nunr mein problem, jedes mal wenn er das script aus cron.daily asuführt schickt er mir ne mail an root, wie kann ich diese mail unterdrücken? die ist unnütze, so sieht die msg aus:
>From root Thu Feb 14 00:16:51 2002
Return-Path: <root@linux.local>
Received: (from root@localhost)
by linux.local (8.11.3/8.11.3/SuSE Linux 8.11.1-0.5) id g1DNGnx04099
for root; Thu, 14 Feb 2002 00:16:50 +0100
Date: Thu, 14 Feb 2002 00:16:50 +0100
Message-Id: <200202132316.g1DNGnx04099@linux.local>
From: root@linux.local (Cron Daemon)
To: root@linux.local
Subject: Cron <root@linux> test -x /usr/lib/cron/run-crons && /usr/lib/cron/run-crons
X-Cron-Env: <SHELL=/bin/sh>
X-Cron-Env: <PATH=/usr/bin:/usr/sbin:/sbin:/bin:/usr/lib/news/bin>
X-Cron-Env: <MAILTO=root>
X-Cron-Env: <HOME=/root>
X-Cron-Env: <LOGNAME=root>

14 Feb 00:16:48 ntpdate[4098]: ntpdate 4.0.99f Tue May 15 21:59:01 GMT 2001 (1)
14 Feb 00:16:50 ntpdate[4098]: step time server 130.133.1.10 offset 0.966126 sec

any suggestion?

mfg alex

CoreDump

Re: cron

#2 Post by CoreDump »

setze MAILTO=

siehe dazu: man 5 crontab

Jochen

Re: cron

#3 Post by Jochen »

Alternativ dazu an das Kommando in der crontab-Zeile ein ">/dev/null 2>&1" anhängen, damit es keine Ausgabe produziert. Diese werden sonst vom cron abgefangen und an den User gemailt.

Jochen

ratte

Re: cron

#4 Post by ratte »

am ende der zeile folgendes einfuegen:
<blockquote><pre><font size="1" face="">code:</font><hr><font face="Courier New" size="2">
1>/dev/null 2>&1
</font><hr></pre></blockquote>

ratte

Post Reply