Results 1 to 7 of 7
  1. #1
    Join Date
    Oct 2009
    Posts
    10

    Default Interpreter in cron shell scripts

    Domain kwinzi.co.uk.
    IP address: Not known.

    Hi there.

    I have set up a shell script which I am trying to run via cron. The first lines of the script are..

    #!/bin/sh

    /usr/bin/mysqldump....

    When it runs I get the error

    /bin/sh /home/myusername/scriptname.sh: /bin/sh
    :bad interpreter: No such file or directory


    I also tried #!/bin/bash and get the same error except it says sh: /bin/bash (as you'd expect!)


    My question is what do I need to do to tell it what interpreter to use?

    Thanks,

    BTW, I've been live now for just over a week and have put in place a monitoring service. 100% uptime and response time from the UK mostly less than 1/10th of a second. Fantastic service so far - thanks very much.

  2. #2
    Join Date
    Apr 2007
    Posts
    426

    Default

    Quote Originally Posted by Kwinzi View Post
    I have set up a shell script which I am trying to run via cron. The first lines of the script are..

    #!/bin/sh

    /usr/bin/mysqldump....

    When it runs I get the error

    /bin/sh /home/myusername/scriptname.sh: /bin/sh
    :bad interpreter: No such file or directory


    I also tried #!/bin/bash and get the same error except it says sh: /bin/bash (as you'd expect!)

    My question is what do I need to do to tell it what interpreter to use?
    You won't have a privilege to run a script with /usr/bin/ or /bin/bash interpreter due to which you are getting such error. We do offer SSH access only on our few servers , on which you can run such type of bash/shell scripts . I would like to recommend you kindly use the simple php script to make the backup of your databases. Let me know if you want PHP mysqldump script.
    Thanks and Regards,
    Alex Parker
    Senior System Administrator.
    Dedicated Hosting || Semi Dedicated Hosting|Disaster Recovery Solutions

    EMAIL:alex @ eukhost.com
    MSN: alex @ eukhost.com
    SKYPE: euk_alexp

  3. #3
    Join Date
    Oct 2009
    Posts
    10

    Default

    Well, it didn't like blank lines in the shell script, but oce I'd got rid of them it worked fine. Many thanks.

  4. #4
    Join Date
    Oct 2006
    Location
    localhost
    Posts
    3,375

    Smile

    Quote Originally Posted by Kwinzi View Post
    Well, it didn't like blank lines in the shell script, but oce I'd got rid of them it worked fine. Many thanks.
    The blank lines in the Linux scripts are formed when creating scripts on Windows machines

    Rock _a.k.a._ Jack
    Windows Hosting || Windows Reseller Hosting
    Cloud Hosting 100% UPTIME! || Powerful Dedicated Servers
    Follow eUKhost on Twitter || Join eUKhost Community on Facebook

    For complaints, grievances or suggestions kindly email our FeedBack Dept.
    Proper action will be taken accordingly & instantaneously!

  5. #5
    Join Date
    Oct 2009
    Posts
    10

    Default

    Oops, replies got crossed.

    I don't mind running a PHP one - its just that I found something in these forums that said while you didn't offer SSH to shared hosting a/cs but that shell scripts could still be run as cron jobs which was fine for my needs.
    If Alex and Eric get together to decide what I am allowed/not allowed to do then I will comply.

  6. #6
    Join Date
    Apr 2007
    Posts
    426

    Default

    Quote Originally Posted by Kwinzi View Post
    Oops, replies got crossed.

    If Alex and Eric get together to decide what I am allowed/not allowed to do then I will comply.
    Eric had given Jailshell access to your cpanel user then run the script, definitely it should work as I told in my previous post . But we don't provide Jailshell access on this server in which currently your account is hosted.

    Let me know if you need any help to configure PHP script to take a backup of your databases.
    Thanks and Regards,
    Alex Parker
    Senior System Administrator.
    Dedicated Hosting || Semi Dedicated Hosting|Disaster Recovery Solutions

    EMAIL:alex @ eukhost.com
    MSN: alex @ eukhost.com
    SKYPE: euk_alexp

  7. #7
    Join Date
    Oct 2009
    Posts
    10

    Default

    Hi there,

    I have just gone in this morning and someone has removed all my cron jobs - not the actual scripts - just the entry in the crontab or whatever you call it. Most of them were PHP scripts so clearly nothing to with shell scripts as discussed in this thread.

    Investigation shows it happened about 07:20 yesterday morning (12th Nov).

    Whats going on please!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •