Crontab error - Redhat

This is a discussion on Crontab error - Redhat ; Hi: Can you explain me why this crontab entry terminates with this error ? 1 0 * * * /scripts/nmon_x86_rhel4 -F /scripts/log/NMON`date '+ %d'`.nmon -t -s 300 -c 2880 /bin/sh: -c: line 0: unexpected EOF while looking for matching ``' ...

+ Reply to Thread
Results 1 to 5 of 5

Thread: Crontab error

  1. Crontab error



    Hi:
    Can you explain me why this crontab entry terminates with this error ?

    1 0 * * * /scripts/nmon_x86_rhel4 -F /scripts/log/NMON`date '+
    %d'`.nmon -t -s 300 -c 2880


    /bin/sh: -c: line 0: unexpected EOF while looking for matching ``'
    /bin/sh: -c: line 1: syntax error: unexpected end of file

  2. Re: Crontab error

    apogeusistemas@gmail.com wrote:
    >
    > Hi:
    > Can you explain me why this crontab entry terminates with this error ?
    >
    > 1 0 * * * /scripts/nmon_x86_rhel4 -F /scripts/log/NMON`date '+
    > %d'`.nmon -t -s 300 -c 2880
    >
    >
    > /bin/sh: -c: line 0: unexpected EOF while looking for matching ``'
    > /bin/sh: -c: line 1: syntax error: unexpected end of file

    Apogeusistemas,


    If the line is really like teh one show, then it is broken.

    Cron, like the shell does not want Linefeeds in a statement.

    So try to take the Linefeed away.

    Did not you get a warning when closing the crontab editor?


    Kind regards,


    Jan Gerrit Kootstra

  3. Re: Crontab error

    On Jul 7, 12:12*pm, Jan Gerrit Kootstra
    wrote:
    > apogeusiste...@gmail.com wrote:
    >
    > > Hi:
    > > Can you explain me why this crontab entry terminates with this error ?

    >
    > > 1 0 * * * /scripts/nmon_x86_rhel4 -F /scripts/log/NMON`date '+
    > > %d'`.nmon -t -s 300 -c 2880

    >
    > > /bin/sh: -c: line 0: unexpected EOF while looking for matching ``'
    > > /bin/sh: -c: line 1: syntax error: unexpected end of file

    >
    > Apogeusistemas,
    >
    > If the line is really like teh one show, then it is broken.
    >
    > Cron, like the shell does not want Linefeeds in a statement.
    >
    > So try to take the Linefeed away.
    >
    > Did not you get a warning when closing the crontab editor?
    >
    > Kind regards,
    >
    > Jan Gerrit Kootstra


    The real command doesn´t haves this break...

  4. Re: Crontab error

    On Mon, 07 Jul 2008 07:13:17 -0700, apogeusistemas typed this message:

    > Hi:
    > Can you explain me why this crontab entry terminates with this error ?
    >
    > 1 0 * * * /scripts/nmon_x86_rhel4 -F /scripts/log/NMON`date '+ %d'`.nmon
    > -t -s 300 -c 2880
    >
    >
    > /bin/sh: -c: line 0: unexpected EOF while looking for matching ``'
    > /bin/sh: -c: line 1: syntax error: unexpected end of file


    Better to put long command lines in a shell script and run that shell
    from cron.

    1 0 * * * sh /home/apoge/rmon.sh

    Corrected command:
    /scripts/nmon_x86_rhel4 -F /scripts/log/NMON`date +" "%d`.nmon-t -s 300 -
    c 2880

    or
    /scripts/nmon_x86_rhel4 -F /scripts/log/NMON$(date +" "%d).nmon-t -s 300 -
    c 2880

  5. Re: Crontab error

    In article <5a6e10f6-0db0-4741-9ee7-8571a97eed89@x41g2000hsb.googlegroups.com>,
    wrote:
    :
    :
    :Hi:
    :Can you explain me why this crontab entry terminates with this error ?
    :
    :1 0 * * * /scripts/nmon_x86_rhel4 -F /scripts/log/NMON`date '+
    :%d'`.nmon -t -s 300 -c 2880
    :
    :
    :/bin/sh: -c: line 0: unexpected EOF while looking for matching ``'
    :/bin/sh: -c: line 1: syntax error: unexpected end of file


    Read the manpage for the crontab file (`man 5 crontab`) and pay
    particular attention to the discussion of the "%" character.
    (You need to escape the "%" character with a backslash.)

    --
    Bob Nichols AT comcast.net I am "RNichols42"

+ Reply to Thread