Thread: crontab problem
View Single Post

   
  #3 (permalink)  
Old 01-16-2008, 11:35 AM
Fuliggians
 
Posts: n/a
Default Re: crontab problem

On 19 Nov, 17:53, g...@panix.com (Greg Andrews) wrote:
> Fuliggians <fuliggi...@gmail.com> writes:
>
> >here my problem:
> >I've got this bash script very simple that work fine if I run it via
> >shell
> >$ ./test.sh

>
> >I want to use it with crontab
> >and in this case the system generate 2 problems:

>
> >1) I know that crontab do not Inherit the paths etc...
> >in this case I tried to insert - as described in many forums - PATH
> >HOME etc... directly in the cron file
> >here the first problem. I can't add anything in the cron except the
> >usual format (like * * * * * /test.sh)
> >so I puth the path directly inside the test script. I don't like it
> >but it works. Why I'm not able to edit also the path inside the cron?
> >I tried both with su and normal user

>
> You have bash-specific commands in your script, but you don't seem
> to have the line that make sure bash will interpret your script.
> Is the very first line of your script:
>
> #!/usr/bin/bash
>
> If not, the SunOS/Solaris cron will try to run your script with the
> Bourne shell, which doesn't understand the bash-specific commands.
>
> -Greg
> --
> Do NOT reply via e-mail.
> Reply in the newsgroup.


Thanks! Yeah!

But now I have to solve also the point 1.
Infact if I'm not able to add inside the cron file the PATH, some
other Perl script are not able to run, because they can't find some
modules.
This is crazy: why am I not able to specify the PATH in the cron file?
also as root this is impossible, this is the error it generate when I
try to save the file:
"crontab: error on previous line; unexpected character found in line.
crontab: errors detected in input, no crontab file generated."
Reply With Quote