Cron Job

Hi, I'm trying to set up a cron job with Go Daddy. The supported languages and associated interpreter lines are as follows:

  • Perl: #!/usr/bin/perl
  • Python 2.2: #!/usr/bin/python2.2
  • Python 2.3: #!/usr/bin/python2.3
  • Python 2.4: #!/usr/bin/python2.4
  • Ruby: #!/usr/local/bin/ruby
  • Bash: #!/bin/bash
  • PHP 4: /web/cgi-bin/php 
  • PHP 5: /web/cgi-bin/php5

I have changed the cron file name from crontab.example to crontab, and placed it in the root directory. I also have edited the crontab file as follows:

# Crontab example.
#
# This file is an example of triggering Elgg cron events. It hits a URL to
# trigger the events. For testing, you can simulate the cronjob by loading the
# URL in a browser.
#
# See http://docs.elgg.org/wiki/Cron for more information
#
# @author Marcus Povey

# Location of GET (see: http://docs.elgg.org/wiki/What_is_get)
GET='/usr/bin/perl'

# Location of your site (don't forget the trailing slash!)
ELGG='my domain name with the trailing slash'

# The crontab
# Don't edit below this line unless you know what you are doing
@reboot $GET ${ELGG}cron/reboot/
* * * * * $GET ${ELGG}cron/minute/
*/5 * * * * $GET ${ELGG}cron/fiveminute/
15,30,45,59 * * * * $GET ${ELGG}cron/fifteenmin/
30,59 * * * * $GET ${ELGG}cron/halfhour/
@hourly $GET ${ELGG}cron/hourly/
@daily $GET ${ELGG}cron/daily/
@weekly $GET ${ELGG}cron/weekly/
@monthly $GET ${ELGG}cron/monthly/
@yearly $GET ${ELGG}cron/yearly/ 

But I'm getting the following email message: 

Semicolon seems to be missing at /var/chroot/home/content/07/11426407/html/crontab line 14.
Array found where operator expected at /var/chroot/home/content/07/11426407/html/crontab line 19, at end of line
    (Missing semicolon on previous line?)
Scalar found where operator expected at /var/chroot/home/content/07/11426407/html/crontab line 19, near "@reboot $GET"
    (Missing operator before $GET?)
Scalar found where operator expected at /var/chroot/home/content/07/11426407/html/crontab line 19, near "$GET ${ELGG}"
    (Missing operator before ${ELGG}?)
Bareword found where operator expected at /var/chroot/home/content/07/11426407/html/crontab line 19, near "${ELGG}cron"
    (Missing operator before cron?)
Scalar found where operator expected at /var/chroot/home/content/07/11426407/html/crontab line 20, near "* * $GET"
    (Missing operator before  $GET?)
Scalar found where operator expected at /var/chroot/home/content/07/11426407/html/crontab line 20, near "$GET ${ELGG}"
    (Missing operator before ${ELGG}?)
Bareword found where operator expected at /var/chroot/home/content/07/11426407/html/crontab line 20, near "${ELGG}cron"
    (Missing operator before cron?)
Number found where operator expected at /var/chroot/home/content/07/11426407/html/crontab line 21, near "*/5"
    (Missing operator before 5?)
Scalar found where operator expected at /var/chroot/home/content/07/11426407/html/crontab line 21, near "$GET ${ELGG}"
    (Missing operator before ${ELGG}?)
Bareword found where operator expected at /var/chroot/home/content/07/11426407/html/crontab line 21, near "${ELGG}cron"
    (Missing operator before cron?)
Scalar found where operator expected at /var/chroot/home/content/07/11426407/html/crontab line 22, near "$GET ${ELGG}"
    (Missing operator before ${ELGG}?)
Bareword found where operator expected at /var/chroot/home/content/07/11426407/html/crontab line 22, near "${ELGG}cron"
    (Missing operator before cron?)
Scalar found where operator expected at /var/chroot/home/content/07/11426407/html/crontab line 23, near "$GET ${ELGG}"
    (Missing operator before ${ELGG}?)
Bareword found where operator expected at /var/chroot/home/content/07/11426407/html/crontab line 23, near "${ELGG}cron"
    (Missing operator before cron?)
Scalar found where operator expected at /var/chroot/home/content/07/11426407/html/crontab line 24, near "@hourly $GET"
    (Missing operator before $GET?)
Scalar found where operator expected at /var/chroot/home/content/07/11426407/html/crontab line 24, near "$GET ${ELGG}"
    (Missing operator before ${ELGG}?)
Bareword found where operator expected at /var/chroot/home/content/07/11426407/html/crontab line 24, near "${ELGG}cron"
    (Missing operator before cron?)
Scalar found where operator expected at /var/chroot/home/content/07/11426407/html/crontab line 25, near "@daily $GET"
    (Missing operator before $GET?)
Scalar found where operator expected at /var/chroot/home/content/07/11426407/html/crontab line 25, near "$GET ${ELGG}"
    (Missing operator before ${ELGG}?)
Bareword found where operator expected at /var/chroot/home/content/07/11426407/html/crontab line 25, near "${ELGG}cron"
    (Missing operator before cron?)
Scalar found where operator expected at /var/chroot/home/content/07/11426407/html/crontab line 26, near "@weekly $GET"
    (Missing operator before $GET?)
Scalar found where operator expected at /var/chroot/home/content/07/11426407/html/crontab line 26, near "$GET ${ELGG}"
    (Missing operator before ${ELGG}?)
Bareword found where operator expected at /var/chroot/home/content/07/11426407/html/crontab line 26, near "${ELGG}cron"
    (Missing operator before cron?)
Scalar found where operator expected at /var/chroot/home/content/07/11426407/html/crontab line 27, near "@monthly $GET"
    (Missing operator before $GET?)
Scalar found where operator expected at /var/chroot/home/content/07/11426407/html/crontab line 27, near "$GET ${ELGG}"
    (Missing operator before ${ELGG}?)
Bareword found where operator expected at /var/chroot/home/content/07/11426407/html/crontab line 27, near "${ELGG}cron"
    (Missing operator before cron?)
Scalar found where operator expected at /var/chroot/home/content/07/11426407/html/crontab line 28, near "@yearly $GET"
    (Missing operator before $GET?)
Scalar found where operator expected at /var/chroot/home/content/07/11426407/html/crontab line 28, near "$GET ${ELGG}"
    (Missing operator before ${ELGG}?)
Bareword found where operator expected at /var/chroot/home/content/07/11426407/html/crontab line 28, near "${ELGG}cron"
    (Missing operator before cron?)
syntax error at /var/chroot/home/content/07/11426407/html/crontab line 15, near "ELGG"
Execution of /var/chroot/home/content/07/11426407/html/crontab aborted due to compilation errors. 

What am I getting wrong? 

  • Not specific to godaddy:

    The GET variable is to be assigned the path to the get (or alternatively the wget) command. Don't know why you assign it the perl executable.

    I'm not using the GET and ELGG variable at all anymore but give the full values in each job line, e.g.

    * * * * * /usr/bin/wget --spider --output-document=/dev/null http://site.url/cron/minute/ >/dev/null 2>&1

    You might not need to use the crontab file or it might not be taken into account by the godaddy server setting. But you should also be able to define cronjobs via the server admin frontend (CPanel or similar).