Go Back   Forum Care Forums > Development Reference Area > Webmaster Topics

Reply
 
LinkBack Thread Tools Display Modes
Can you spot the error?
Old
  (#1)
plato
Guest
 
Posts: n/a
Default Can you spot the error? - 05-14-2007, 01:45 AM

I am having trouble running a cron job, maybe you can see what is wrong
here.
I have created a folder in the public_html directory called stats
I have inserted a script called update.sh into the cgi-bin and ensured the
permissions are 755

Here is the update.sh file:
#!/bin/bash
cp tmp/webalizer/*.html tmp/webalizer/*.png
tmp/webalizer/webalizer.*public_html/stats

when i run the script I get this error:
/bin/sh: /home/corrobex/public_html/cgi-bin/update.sh: /bin/bash
: bad interpreter: No such file or directory

Anyone have any clue I may have missed here? thanks


   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Re: Can you spot the error?
Old
  (#2)
Toby Inkster
Guest
 
Posts: n/a
Default Re: Can you spot the error? - 05-14-2007, 01:45 AM

plato wrote:

> /bin/bash : bad interpreter: No such file or directory


Does '/bin/bash' exist?

Try /bin/sh.

> Here is the update.sh file:
> #!/bin/bash
> cp tmp/webalizer/*.html tmp/webalizer/*.png
> tmp/webalizer/webalizer.*public_html/stats


I ***ume the mangled wrapping is caused by your news client, and the
script is properly wrapped on your server.

Ditto 'tmp/webalizer/webalizer.*public_html/stats' should have some white
space after the asterisk.

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact

   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Re: Can you spot the error?
Old
  (#3)
Andy Dingley
Guest
 
Posts: n/a
Default Re: Can you spot the error? - 05-14-2007, 01:45 AM



On 25 Jan, 10:52, "plato" <platoTAKETHIS...@telpacific.com.au> wrote:
> when i run the script I get this error:
> /bin/sh: /home/corrobex/public_html/cgi-bin/update.sh: /bin/bash
> : bad interpreter: No such file or directory


Try a more generic shebang of #!/bin/sh
Check the end of line character

   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Re: Can you spot the error?
Old
  (#4)
Chris F.A. Johnson
Guest
 
Posts: n/a
Default Re: Can you spot the error? - 05-14-2007, 01:45 AM

On 2007-01-25, plato wrote:
> I am having trouble running a cron job, maybe you can see what is wrong
> here.
> I have created a folder in the public_html directory called stats
> I have inserted a script called update.sh into the cgi-bin and ensured the
> permissions are 755
>
> Here is the update.sh file:
> #!/bin/bash
> cp tmp/webalizer/*.html tmp/webalizer/*.png
> tmp/webalizer/webalizer.*public_html/stats


I presume that the last two lines should all be on the same line.

You are missing a space before the destination directory:

cp tmp/webalizer/*.html tmp/webalizer/*.png > tmp/webalizer/webalizer.* public_html/stats

> when i run the script I get this error:
> /bin/sh: /home/corrobex/public_html/cgi-bin/update.sh: /bin/bash
>: bad interpreter: No such file or directory


That usually means that you wrote the script on a Microsoft
platform and didn't convert the line endings when copying it to a
*nix machine.

Or, perhaps, your copy of bash is not in /bin.

--
Chris F.A. Johnson <http://cfaj.freeshell.org>
================================================== =================
Author:
Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)
   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





Contact Us - Forum Care Forums - Archive - Top