Nejde úloha z CRONu

Roman Nádhera roman at nadhera.name
Thu Mar 29 08:46:14 CEST 2012


Dobry den,

nevimproc mi nechodi uloha z CRONu.
Jedna se o skript mymail v poslednim radku crontab.

V /etc/crontab je:
> # /etc/crontab - root's crontab for FreeBSD
> #
> # $FreeBSD$
> #
> SHELL=/bin/sh
> PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin
> #
> #minute hour    mday    month   wday    who     command
> #
> */5     *       *       *       *       root    /usr/libexec/atrun
> #
> # Save some entropy so that /dev/random can re-seed on boot.
> */11    *       *       *       *       operator /usr/libexec/save-entropy
> #
> # Rotate log files every hour, if necessary.
> 0       *       *       *       *       root    newsyslog
> #
> # Perform daily/weekly/monthly maintenance.
> #1      3       *       *       *       root    periodic daily
> #15     4       *       *       6       root    periodic weekly
> #30     5       1       *       *       root    periodic monthly
> #
> # Adjust the time zone if the CMOS clock keeps local time, as opposed to
> # UTC time.  See adjkerntz(8) for details.
> 1,31    0-5     *       *       *       root    adjkerntz -a
> #
> 15,45   *       *       *       *       root    /util/mymail >/dev/null 2>&1
> 

Obsah soubotu /util/mymail je

> 
> #! /bin/bash
> 
> sysctl -a | grep -e temperature | cut -c 33-50      > /tmp/statmail.txt
> smartctl -a /dev/ada0 | grep Temper | cut -c 87-90 >> /tmp/statmail.txt
> echo ======================================  >> /tmp/statmail.txt
> cp /var/log/apcupsd.status  /tmp/apcupsd.status.txt
> cat /var/log/auth.log | grep -e error -e fail >> /tmp/statmail.txt
> echo ======================================  >> /tmp/statmail.txt
> 
> 
> smtpmail -t moje.adresaa na xxxx.cz \
>     -H 192.168.1.1         \
>     -f yyyyyy na xxxx.cz   \
>     -s "Persefona server report"            \
>     -a /tmp/apcupsd.status.txt  \
>     -v                     \
>     /tmp/statmail.txt
> 
> # rm /tmp/statmail.txt


Když spustím rucne  /util/mymail, tak se provede spravne.

To mi nekdo reknete, proc cron na to kasle.. 8-(








More information about the Users-l mailing list