Crontab Doubt

Hi:

I put a job in crontab, but I didn=B4t get log=B4s output, how could I
search for errors in cron execution ?

# crontab -l
10 0 1 * * /var/adm/sa/sar_autom > /usr/user/logs/1.lis


# ls -l 1.lis
-rw-r--r-- 1 root other 0 Jan 1 00:10 1.lis

Thank You.
apogeusistemas [ Mi, 02 Januar 2008 21:03 ] [ ID #1897690 ]

Re: Crontab Doubt

apogeusistemas [at] gmail.com wrote:
>
> I put a job in crontab, but I didn´t get log´s output, how could I
> search for errors in cron execution ?
>
> # crontab -l
> 10 0 1 * * /var/adm/sa/sar_autom > /usr/user/logs/1.lis

Is there output if you start this as root in your shell?

/var/adm/sa/sar_autom

> # ls -l 1.lis
> -rw-r--r-- 1 root other 0 Jan 1 00:10 1.lis

--
Best regards | Be nice to America or they'll bring democracy to
Cyrus | your country.
Cyrus Kriticos [ Mi, 02 Januar 2008 21:18 ] [ ID #1897691 ]

Re: Crontab Doubt

On 2 jan, 18:18, Cyrus Kriticos <cyrus.kriti... [at] googlemail.com> wrote:
> apogeusiste... [at] gmail.com wrote:
>
> > I put a job in crontab, but I didn=B4t get log=B4s output, how could I
> > search for errors in cron execution ?
>
> > # crontab -l
> > 10 0 1 * * /var/adm/sa/sar_autom > /usr/user/logs/1.lis
>
> Is there output if you start this as root in your shell?
>
> /var/adm/sa/sar_autom
>
> > # ls -l 1.lis
> > -rw-r--r-- =A0 1 root =A0 =A0 other =A0 =A0 =A0 =A0 =A00 Jan =A01 00:10 =
1.lis
>
> --
> =A0 =A0Best regards =A0| =A0Be nice to America or they'll bring democracy =
to
> =A0 =A0Cyrus =A0 =A0 =A0 =A0 | =A0your country.

Yes, if I execute the script in command line it works fine, but
in crontab I don=B4t get no output...
apogeusistemas [ Mi, 02 Januar 2008 21:22 ] [ ID #1897692 ]

Re: Crontab Doubt

apogeusistemas [at] gmail.com wrote:
> On 2 jan, 18:18, Cyrus Kriticos <cyrus.kriti... [at] googlemail.com> wrote:
>> apogeusiste... [at] gmail.com wrote:
>>
>>> I put a job in crontab, but I didn´t get log´s output, how could I
>>> search for errors in cron execution ?
>>> # crontab -l
>>> 10 0 1 * * /var/adm/sa/sar_autom > /usr/user/logs/1.lis
>> Is there output if you start this as root in your shell?
>>
>> /var/adm/sa/sar_autom
>>
>>> # ls -l 1.lis
>>> -rw-r--r-- 1 root other 0 Jan 1 00:10 1.lis
>
> Yes, if I execute the script in command line it works fine, but
> in crontab I don´t get no output...

ok, is there still output:

/var/adm/sa/sar_autom 2>/dev/null

--
Best regards | Be nice to America or they'll bring democracy to
Cyrus | your country.
Cyrus Kriticos [ Mi, 02 Januar 2008 21:35 ] [ ID #1897693 ]

Re: Crontab Doubt

On 2 jan, 18:35, Cyrus Kriticos <cyrus.kriti... [at] googlemail.com> wrote:
> apogeusiste... [at] gmail.com wrote:
> > On 2 jan, 18:18, Cyrus Kriticos <cyrus.kriti... [at] googlemail.com> wrote:
> >> apogeusiste... [at] gmail.com wrote:
>
> >>> I put a job in crontab, but I didn=B4t get log=B4s output, how could I=

> >>> search for errors in cron execution ?
> >>> # crontab -l
> >>> 10 0 1 * * /var/adm/sa/sar_autom > /usr/user/logs/1.lis
> >> Is there output if you start this as root in your shell?
>
> >> /var/adm/sa/sar_autom
>
> >>> # ls -l 1.lis
> >>> -rw-r--r-- =A0 1 root =A0 =A0 other =A0 =A0 =A0 =A0 =A00 Jan =A01 00:1=
0 1.lis
>
> > Yes, if I execute the script in command line it works fine, but
> > in crontab I don=B4t get no output...
>
> ok, is there still output:
>
> /var/adm/sa/sar_autom 2>/dev/null
>
> --
> =A0 =A0Best regards =A0| =A0Be nice to America or they'll bring democracy =
to
> =A0 =A0Cyrus =A0 =A0 =A0 =A0 | =A0your country.- Ocultar texto entre aspas=
-
>
> - Mostrar texto entre aspas -

Running this command:

/var/adm/sa/sar_autom 2>/dev/null

I don=B4t get video=B4s output, but script works, because I put
a file=B4s output inside the script:

echo "${linha[*]}" >> $output/sar-cpu-mensal-$pmt-$year.txt

and I have this file:

-rw-r--r-- 1 root other 8957 Jan 2 18:40 sar-cpu-
mensal-12-2007.txt
apogeusistemas [ Mi, 02 Januar 2008 21:45 ] [ ID #1897694 ]
Linux » comp.unix.shell » Crontab Doubt

Vorheriges Thema: simple trap syntax
Nächstes Thema: Can you plot your series data faster/easier?