Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

cron jobs not running

Discussion in 'General Discussion' started by elis2, Nov 22, 2017.

Tags:
  1. elis2

    elis2 Active Member

    Joined:
    Aug 14, 2017
    Messages:
    29
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    Iran
    cPanel Access Level:
    Root Administrator
    hi


    nano /etc/crontab

    SHELL=/bin/bash
    PATH=/sbin:/bin:/usr/sbin:/usr/bin
    MAILTO=root

    # For details see man 4 crontabs

    # Example of job definition:
    # .---------------- minute (0 - 59)
    # | .------------- hour (0 - 23)
    # | | .---------- day of month (1 - 31)
    # | | | .------- month (1 - 12) OR jan,feb,mar,apr ...
    # | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
    # | | | | |
    # * * * * * user-name command to be executed





    cron jobs not running,plz hellp me

    thank you
    Best Regards
     
  2. rpvw

    rpvw Well-Known Member

    Joined:
    Jul 18, 2013
    Messages:
    691
    Likes Received:
    233
    Trophy Points:
    43
    Location:
    Spain
    cPanel Access Level:
    Root Administrator
    You have not told us which users cron is not running, so here is some general information:

    System and root cron jobs can be found in /var/spool/cron/root
    User cron files are in /var/spool/cron/username


    Common commands for manipulating cron:

    "crond start" (Starts the cron daemon)
    "crond stop" (stops the cron daemon)
    "ps aux | grep crond" (check to see if cron daemon is running)
    "crontab -l" (list all cronjobs set by root user)
    "crontab -u username -l" (lists all cronjobs set by username)
    "crontab -e" (edit a cronjob for root user)
    "crontab -u username -e" (edit a cronjob for username)
    "crontab -r" (remove all cronjobs of root user)
    "crontab -u username -r" (remove all cronjobs of username)

    Hope this helps
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
    elis2 likes this.
  3. SysSachin

    SysSachin Well-Known Member

    Joined:
    Aug 23, 2015
    Messages:
    604
    Likes Received:
    42
    Trophy Points:
    28
    Location:
    India
    cPanel Access Level:
    Root Administrator
    Twitter:
    Can you please provide the output of the below command

    crontab -l -u username

    And you can check the logs as well

    and provide us the recent logs

    root@web [/var/log]# cat cron | grep username
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
    elis2 likes this.
  4. elis2

    elis2 Active Member

    Joined:
    Aug 14, 2017
    Messages:
    29
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    Iran
    cPanel Access Level:
    Root Administrator
    Daar thank you for answer.

    According to user cron job connect,and disconnect At some hours.
    Code:
    [root@server ~]# crontab -l -u user
    MAILTO="user@yahoo.com"
    SHELL="/usr/local/cpanel/bin/jailshell"
    */5 * * * * /usr/bin/php -q /home/user/public_html/folder/file.php >/dev/null
    2 8 * * * /usr/bin/php -q /home/user/public_html/folder/file.php
    */10 * * * * /usr/bin/php -q /home/user/public_html/video/file1.php >/dev/null
    */12 * * * * /usr/bin/php -q /home/user/public_html/video/file2.php >/dev/null
    50 7 * * * /usr/bin/php -q /home/user/public_html/folder/file.php
    [root@server ~]#
    
    
    
    Nov 25 08:10:01 server CROND[1145]: (user) CMD (/usr/bin/php -q /home/user/public_html/video/file.php >/dev/null)
    Nov 25 08:10:01 server CROND[1200]: (user) CMD (/usr/bin/php -q /home/user/public_html/folder/file.php >/dev/null)
    Nov 25 08:12:01 server CROND[3341]: (user) CMD (/usr/bin/php -q /home/user/public_html/video/file.php >/dev/null)
    Nov 25 08:12:18 server crontab[3664]: (user) LIST (user)
    Nov 25 08:12:19 server crontab[3676]: (user) LIST (user)
    Nov 25 08:12:50 server crontab[3999]: (user) LIST (user)
    Nov 25 08:12:50 server crontab[4000]: (user) REPLACE (user)
    Nov 25 08:12:58 server crontab[4046]: (user) LIST (user)
    Nov 25 08:12:58 server crontab[4047]: (user) REPLACE (user)
    Nov 25 08:13:01 server crond[16797]: (user) RELOAD (/var/spool/cron/user)
    Nov 25 08:13:07 server crontab[4357]: (user) LIST (user)
    Nov 25 08:13:07 server crontab[4358]: (user) REPLACE (user)
    Nov 25 08:13:16 server crontab[4414]: (user) LIST (user)
    Nov 25 08:13:16 server crontab[4415]: (user) REPLACE (user)
    Nov 25 08:13:47 server crontab[4576]: (user) LIST (user)
    Nov 25 08:13:47 server crontab[4577]: (user) REPLACE (user)
    Nov 25 08:14:01 server crond[16797]: (user) RELOAD (/var/spool/cron/user)
    Nov 25 08:15:01 server CROND[5414]: (user) CMD (/usr/bin/php -q /home/user/public_html/folder/file.php >/dev/null)
    Nov 25 08:20:01 server CROND[9158]: (user) CMD (/usr/bin/php -q /home/user/public_html/video/file.php >/dev/null)
    
    


    me check log cron croon some time connect and disconnect.

    thnk you
     
    #4 elis2, Nov 25, 2017
    Last edited by a moderator: Nov 25, 2017
  5. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    43,889
    Likes Received:
    1,814
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    Can you provide more details about what in-particular is not working, or which particular cron job is not running?

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice