raghu_shekar has asked for the wisdom of the Perl Monks concerning the following question:

This node falls below the community's threshold of quality. You may see it by logging in.

Replies are listed 'Best First'.
Re: running shell script in cron
by Anonymous Monk on Mar 24, 2009 at 07:23 UTC
    1. please use code tags
    2. please explain how it doesn't work
    A reply falls below the community's threshold of quality. You may see it by logging in.
Re: running shell script in cron
by irah (Pilgrim) on Mar 24, 2009 at 08:04 UTC

    Whether your shell script working fine without crontab?. If it is working fine, check the permission for your bash script file. It must have execute permission. If your script is not working, check out the shell script. I think there is no need to change crontab entries.

    A reply falls below the community's threshold of quality. You may see it by logging in.
Re: running shell script in cron
by rovf (Priest) on Mar 24, 2009 at 09:02 UTC

    I wonder whether that program really worked outside the cron job. At least the command

    cd $sc `script1.pl S & `
    looks weird (or there are some arcane corners in shell scripting I'm still missing). Could you explain what it is supposed to do? I've never seen the use of the ampersand inside backquotes...

    -- 
    Ronald Fischer <ynnor@mm.st>
      I wonder if there is some missing assignment (result of ``, which would still make cd fail in a normal, mordern bourne-like shell) or a missing semicolon (after the cd argument) ...
      im trying to run the script in background and that s why im using '&'...... am i doin something wrong here??

        I was thinking that using & inside backquotes wouldn't work (and it doesn't make much sense since the caller would have to wait for the completion anyway). I tried it on Cygwin Perl, and at least it works here (using bash for shelling out). I don't know whether this is supposed to work in general.

        Another strange thing in your code is that you have
        cd $sc `...`
        So provided your backquoted string substitutes to blablabla, you would have something like
        cd $sc blablabla
        What is this supposed to do?

        -- 
        Ronald Fischer <ynnor@mm.st>
Re: running shell script in cron
by slacker (Friar) on Mar 24, 2009 at 14:34 UTC
    Did you verify the script has execute permissions?
      yes i did verify.. the script has execute permission