The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Cron job not working. Help!!!

Discussion in 'General Discussion' started by Lor, Dec 19, 2005.

  1. Lor

    Lor Well-Known Member

    Joined:
    Apr 29, 2005
    Messages:
    53
    Likes Received:
    0
    Trophy Points:
    6
    I checked:
    /var/spool/cron - ok, records added
    /usr/local/cpanel/logs/error_log - no error about cron

    I did restart crond

    CPanel version 10.8.1-RELEASE 30

    perl test file:
    #!/usr/bin/perl

    print "Content-type: text/html\n\n";
    print "Cron\n" ;
    exit ;

    The script working fine.

    Please help!!!
     
    #1 Lor, Dec 19, 2005
    Last edited: Dec 19, 2005
  2. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    What does the crontab line look like?
     
  3. Lor

    Lor Well-Known Member

    Joined:
    Apr 29, 2005
    Messages:
    53
    Likes Received:
    0
    Trophy Points:
    6
    */15 * * * * /home/username/public_html/cgi-bin/test.cgi
     
  4. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    Does the script have +x permissions on it? (711 or 755)

    Have you check the cron log file for errors /var/log/cron

    If it's running under the root account, do you have the forwarder set? If it's a user account, have you checked the actual user accounts mailbox for the output, i.e. /home/username/mail/inbox (or /home/username/mail/cur or /new in the case of maildir).
     
  5. Lor

    Lor Well-Known Member

    Joined:
    Apr 29, 2005
    Messages:
    53
    Likes Received:
    0
    Trophy Points:
    6
    my system CentOS
    script have 711. It checked in ssh also. It working
    no any emails sended
    cron log is empty

    in cron.1:

    ....
    Dec 19 11:15:01 server1230 crond[17855]: (root) CMD (/usr/local/cpanel/bin/dcpumon >/dev/null 2>&1)
    Dec 19 11:15:01 server1230 crond[17859]: (root) CMD (/usr/local/cpanel/whostmgr/bin/dnsqueue > /dev/null 2>&1)
    Dec 19 11:15:01 server1230 crond[17860]: (username) CMD (/home/username/public_html/cgi-bin/test.cgi)
    Dec 19 11:20:01 server1230 crond[17926]: (root) CMD (/usr/local/cpanel/bin/dcpumon >/dev/null 2>&1)
    Dec 19 11:20:01 server1230 crond[17927]: (root) CMD (/usr/local/sbin/bfd -q)
     
    #5 Lor, Dec 19, 2005
    Last edited: Dec 19, 2005
  6. Murtaza_t

    Murtaza_t Well-Known Member

    Joined:
    Jan 24, 2005
    Messages:
    476
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Earth
    cPanel Access Level:
    Website Owner
    Dec 19 11:15:01 server1230 crond[17860]: (username) CMD (/home/username/public_html/cgi-bin/test.cgi)

    This line in your cron logs clearly states that cron has been running. Edit you cron with the following and check if you receive mails :

    */15 * * * * /home/username/public_html/cgi-bin/test.cgi | mail email@address

    and restart crond
     
Loading...

Share This Page