#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2013
    Posts
    22
    Rep Power
    0

    Cron job failing bad interpreter: No such file or directory


    CentOs

    I tried adding to:

    /etc/crontab

    It doesn't run.

    When I run it in "apache" user's crontab it runs but fails:

    /bin/sh: /var/www/mydomain.com/public_html/cgi-bin/cgi-lib/cron.pl: /usr/bin/perl^M: bad interpreter: No such file or directory
  2. #2
  3. Jealous Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    14,302
    Rep Power
    9400
    You saved the file with Windows-style line endings. They need to be Unix-style.

    Assuming you have it installed, dos2unix can convert it for you.
    Code:
    # dos2unix -o /var/www/mydomain.com/public_html/cgi-bin/cgi-lib/cron.pl
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2013
    Posts
    22
    Rep Power
    0
    Thanks, that has fixed it

IMN logo majestic logo threadwatch logo seochat tools logo