I have set the Shebang in my code to the below #!/usr/bin/perl
and below is top of my code below, ----------------------------------------------------------------------------------- #!/usr/bin/perl use strict; use warnings; use Net::Ping; my $file_name='hostnames.txt'; my $line; my @host_array; `rm pingnotif*.*`; `touch alive.log`; _----------------------------------------------------------------- Regards Mazhar On 10/11/06, Steve Finkelstein <[EMAIL PROTECTED]> wrote:
What #3 means, is your shebang should contain the full path to perl. This could be something similar to: #!/usr/bin/perl #!/usr/local/bin/perl If you have your shebang set to: #!perl Your cron environment might not be able to find the PATH to the binary. -- Steve On 10/11/06, Mazhar <[EMAIL PROTECTED]> wrote: > > The Answers are > > 1. Is /scripts/xxxx.pl the full path name? > Yes the above is the correct path of the script : when i run perl > /scripts/xxx.pl it runs fine > 2. Does your script have execute permissions > Yes it has execute permissions (i changed it chmod +x for the code file) > > 3. Does the shebang line indicate the full path to the perl binary? > Can u explain me what does the above signify > > Regards > Mazhar > > > > On 10/11/06, Owen Cook < [EMAIL PROTECTED]> wrote: > > > > On Wed, Oct 11, 2006 at 03:03:12PM +0400, Mazhar wrote: > > > Dear All, > > > > > > My Code is to ping a range of IP reading from a text file and if > they > > are > > > not reachable then just write the IP's to a file. Regarding > permissions > > i > > > am running the same script using root previliges and i am able to > run > > the > > > script maually but it is failing if i write the script in cron like > one > > > below, > > > 10 * * * * /scripts/xxxx.pl > > > > > > Can u all please help on the above > > > > > > > > 1. Is /scripts/xxxx.pl the full path name? > > 2. Does your script have execute permissions > > 3. Does the shebang line indicate the full path to the perl binary? > > > > > > > > Owen > > > > > > > > > > > > > > Regards > > > Mazhar > > > > > > > > > On 10/9/06, Paul Johnson <[EMAIL PROTECTED]> wrote: > > > > > > > >On Mon, Oct 09, 2006 at 03:23:49PM +0400, Mazhar wrote: > > > > > > > >> I tried with the below and made my script as executable with > chmod > > > >command > > > >> but the same is not running every 10 minutes. > > > > > > > >Once you have worked out your crontab syntax, almost all cron > problems > > are > > > >due > > > >to permissions or environment. > > > > > > > >> Need your help > > > > > > > >Since you have provided no information whatsoever on how your > script is > > > >failing it is hard to say more than that. > > > > > > > >-- > > > >Paul Johnson - [EMAIL PROTECTED] > > > >http://www.pjcj.net > > > > > > > > -- > > > >