change shell type in crontab

diego.veiga_at_embraer.com.br
Date: 10/31/03

  • Next message: Jason Dixon: "Re: detecting a DDOS attack"
    To: redhat-list@redhat.com
    Date: Fri, 31 Oct 2003 12:43:40 -0200
    
    

    The big problems is this.

    i have this script:
    --------------------->
    #!/bin/bash
    ##########################################################################################
    # program : _tools/sys_backup_pc08spt.bash
    #
    # subject : cria um arquivo de backup de todo o portal e transfere para a
    maquina pc08spt#
    ##########################################################################################
    . /home/rphp/.bash_profile
    /app/portal_spt/htdocs/_tools/sys_funcs.bash
    and go one...
    --------------------->

    the crontab line is this:
    3 5 * * 1-6 `bash -login
    /app/portal_spt/htdocs/_tools/sys_backup_samba.bash`

    but after run the crontab i see in maillog this message:

    /bin/sh: changed: command not found

    the /bin/sh is a link to the /bin/bash
    why the crontab is trying to run the script in sh...?

    diego

    ----- Message from Cameron Simpson <cs@zip.com.au> on Fri, 31 Oct 2003
    15:52:38 +1100 -----
                                       
          To: redhat-list@redhat.com
                                       
     Subject: Re: change shell type in
              crontab
                                       

    On 09:04 30 Oct 2003, diego.veiga@embraer.com.br
    <diego.veiga@embraer.com.br> wrote:
    | I would like to change the shell to execute the crontab (all the programs
    | to execute are bash).
    |
    | the file /etc/crontab is:
    | SHELL=/bin/bash
    | PATH=/sbin:/bin:/usr/sbin:/usr/bin
    | MAILTO=root
    | HOME=/ ...
    |
    | But i?m receiving email with the crontab variable:
    |
    | X-Cron-Env: <LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH>
    | X-Cron-Env: <SHELL=/bin/sh>
    | X-Cron-Env: <HOME=/root>
    | X-Cron-Env: <PATH=/usr/bin:/bin>
    | X-Cron-Env: <LOGNAME=root>
    | Status: RO
    |
    | /bin/sh: changed: command not found

    Are you sure you've posted the complete crontab?

    Anyway, if all the commands are separate scripts and each script starts
    with:

                 #!/bin/bash

    then the Right Thing should happen anyway.

    I do wonder what you're doing that needs bash though...

    --
    Cameron Simpson <cs@zip.com.au> DoD#743
    http://www.cskk.ezoshosting.com/cs/
    The Fano Factor, where theory meets reality.
    Diego Brito Veiga
    Technical Publications
    Phone: +55 (12) 39278368
    Fax: +55 (12) 39273342
    -- 
    redhat-list mailing list
    unsubscribe mailto:redhat-list-request@redhat.com?subject=unsubscribe
    https://www.redhat.com/mailman/listinfo/redhat-list
    

  • Next message: Jason Dixon: "Re: detecting a DDOS attack"

    Relevant Pages

    • Re: crontab issue
      ... your environment ... ... Simon is absolutely right about the script ... ... crontab file ugly, just because you can? ... solved by making the command a separate script. ...
      (AIX-L)
    • Re: crontab issue
      ... But if it works fine from a script, ... questions about crontab problems on this list, most of which could easily be ... solved by making the command a separate script. ... > and the command would not execute. ...
      (AIX-L)
    • Re: crontab related .. again
      ... >>> The above command works fine with the following ... >>> This latter script work in command line. ... > Yes crontab allow */1 specificatin. ... > How to know the cron's working directory how to make the current ...
      (comp.unix.shell)
    • Re: GPG in crontab causes blank messages
      ... When I run my crontab command manually in terminal, ... But since the output of the script contains a big list of files, ... If I remove the GPG portion of the command, ...
      (comp.sys.mac.apps)
    • Re: [kde] Clock
      ... In FreeBSD you ask crontab to do your script any ... Account management: ... crontab, a tiny shell script, ... Archives: http://lists.kde.org/. ...
      (KDE)