Skip to main content

Cron job stopped working

Comments

11 comments

  • David Colter
    Hello Om, Try these: 1. What does the cron log say about running the script? # grep script.php /var/log/cron
    2. What are the time settings shown in the cron panel for the file script.php? Could they have been changed?
    0
  • zid1988
    Hello Om, Try these: 1. What does the cron log say about running the script? # grep script.php /var/log/cron
    2. What are the time settings shown in the cron panel for the file script.php? Could they have been changed?

    Hi David, Thank you for your reply. Please find the output of the grep command below - Jun 19 09:18:01 av-salk CROND[27437]: (username) CMD (/usr/local/bin/php -q /home/username/public_html/script.php) Regarding the time in cron panel, it shows (* * * * *) for Minute, Hour, Day, Month, Weekday. Please advise. I am really confused. Thanks in advance.
    0
  • garconcn
    How about secure log? tail /var/log/secure
    0
  • zid1988
    How about secure log? tail /var/log/secure

    Hi garconcn, Thanks for your reply. Here is the output of the tail command - Jun 24 10:07:17 av-salk sshd[14425]: pam_succeed_if(sshd:session): conversation failed Jun 24 10:07:17 av-salk sshd[14425]: pam_succeed_if(sshd:session): auth could not identify password for [username] Jun 24 10:07:17 av-salk sshd[14425]: pam_unix(sshd:session): session opened for user username by (uid=0) Jun 24 10:07:36 av-salk sshd[15203]: Invalid user redmine from Jun 24 10:07:36 av-salk sshd[15205]: input_userauth_request: invalid user redmine Jun 24 10:07:36 av-salk sshd[15203]: pam_unix(sshd:auth): check pass; user unknown Jun 24 10:07:36 av-salk sshd[15203]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost= Jun 24 10:07:38 av-salk sshd[15203]: Failed password for invalid user redmine from port 59152 ssh2 Jun 24 10:07:38 av-salk sshd[15205]: Received disconnect from : 11: Bye Bye Jun 24 10:07:50 av-salk sudo: username : TTY=pts/0 ; PWD=/home/username ; USER=root ; COMMAND=/bin/bash
    Let me know if you need anything else. Thanks in advance.
    0
  • cPanelLauren
    I have set it to run automatically in my cPanel, and it's not running automatically.

    How have you determined that it isn't running automatically? My point being, if nothing has changed it seems more likely that the email is not being delivered for some reason, you might check the exim logs to determine if there was an issue with sending the email or if it was rejected.
    0
  • garconcn
    Hi garconcn, Thanks for your reply. Here is the output of the tail command - Jun 24 10:07:17 av-salk sshd[14425]: pam_succeed_if(sshd:session): conversation failed Jun 24 10:07:17 av-salk sshd[14425]: pam_succeed_if(sshd:session): auth could not identify password for [username] Jun 24 10:07:17 av-salk sshd[14425]: pam_unix(sshd:session): session opened for user username by (uid=0) Jun 24 10:07:36 av-salk sshd[15203]: Invalid user redmine from Jun 24 10:07:36 av-salk sshd[15205]: input_userauth_request: invalid user redmine Jun 24 10:07:36 av-salk sshd[15203]: pam_unix(sshd:auth): check pass; user unknown Jun 24 10:07:36 av-salk sshd[15203]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost= Jun 24 10:07:38 av-salk sshd[15203]: Failed password for invalid user redmine from port 59152 ssh2 Jun 24 10:07:38 av-salk sshd[15205]: Received disconnect from : 11: Bye Bye Jun 24 10:07:50 av-salk sudo: username : TTY=pts/0 ; PWD=/home/username ; USER=root ; COMMAND=/bin/bash
    Let me know if you need anything else. Thanks in advance.

    Thanks for the log. One of my server has exactly same issue since Jun 20th. I just found several other reports from stackexchange, they run WHM/cPanel too. Sorry, I don't have a solution. - Removed -
    0
  • zid1988
    How have you determined that it isn't running automatically? My point being, if nothing has changed it seems more likely that the email is not being delivered for some reason, you might check the exim logs to determine if there was an issue with sending the email or if it was rejected.

    Hi Lauren, Thank you for your reply on this thread. Actually, I have a CRM that fetches emails from a domain based email using a PHP script which I have set to run automatically using the cPanel Cron jobs panel. So whenever somebody sends an email to that specific email address, it lands in my CRM. Now the issue is that I am receiving emails on that email address but nothing is landing in the CRM. But if I go ahead and run the script manually using the direct link (www.example.com/script.php), the email lands into the CRM. Hence, I thought that maybe the Cron job is not running automatically. P.S.- Our email server was down a few days ago, so I contacted support and they asked me to restart the exim server. Since then this issue is happening. Let me know your thoughts. Thanks in advance.
    0
  • zid1988
    Thanks for the log. One of my server has exactly same issue since Jun 20th. I just found several other reports from stackexchange, they run WHM/cPanel too. Sorry, I don't have a solution. - Removed -

    No problem. Thanks for trying though. Appreciate it.
    0
  • cPanelLauren
    Based on the output from the cron log it looks like the cron is running but, it also would sound like there is an error. While it may be related to the issue @garconcn is referencing none of the entries in your output of /var/log/secure reference an issue with cron, they're all SSH specific. Do you have selinux enabled on the server? You might check by running the following: sestatus
    0
  • zid1988
    Based on the output from the cron log it looks like the cron is running but, it also would sound like there is an error. While it may be related to the issue @garconcn is referencing none of the entries in your output of /var/log/secure reference an issue with cron, they're all SSH specific. Do you have selinux enabled on the server? You might check by running the following: sestatus

    selinux status shows as disabled. Do I need to enable it? How do I do that?
    0
  • cPanelLauren
    That's good, It shouldn't be enabled as it can cause issues with cPanel/WHM. If you have root access to the server (which I'm assuming you do) feel free to open a ticket using the link in my signature? Once open please reply with the Ticket ID here so that we can update this thread with the resolution once the ticket is resolved. Thanks!
    0

Please sign in to leave a comment.