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 JOBs Not running on a specific site

Discussion in 'General Discussion' started by shanit, Dec 26, 2005.

  1. shanit

    shanit Well-Known Member

    Joined:
    Dec 18, 2005
    Messages:
    46
    Likes Received:
    0
    Trophy Points:
    6
    Hi I have searched this site and I am still searching but I have a complaining customer, this customer is the only one on the server whose cronjobs dont run I have searched the error logs and will post if requested BUT they dont have anything about cron job in them, can I look some where else specifically for errors for this one account??? all help is appreciated as I'm at a loss I have tried everything i have read as far as what was close to fixing the problem and nothing worked so far

    Thanks
    Shannon
     
  2. dalem

    dalem Well-Known Member
    PartnerNOC

    Joined:
    Oct 24, 2003
    Messages:
    2,577
    Likes Received:
    40
    Trophy Points:
    48
    Location:
    SLC
    cPanel Access Level:
    DataCenter Provider
    try

    grep username /var/log/cron

    it might help if you posted the cron thy are trying to run
     
  3. shanit

    shanit Well-Known Member

    Joined:
    Dec 18, 2005
    Messages:
    46
    Likes Received:
    0
    Trophy Points:
    6
  4. dalem

    dalem Well-Known Member
    PartnerNOC

    Joined:
    Oct 24, 2003
    Messages:
    2,577
    Likes Received:
    40
    Trophy Points:
    48
    Location:
    SLC
    cPanel Access Level:
    DataCenter Provider
    i asume you are trying to run every ten minutes then below is the correct syntax
    did you check the cron logs to see if it is executing is crond running?
    are you getting an error email ??

    remove the "> /dev/null" and see the output email if all ok then the script iself is to blame not the cron
     
  5. shanit

    shanit Well-Known Member

    Joined:
    Dec 18, 2005
    Messages:
    46
    Likes Received:
    0
    Trophy Points:
    6
    I have set it with out the > /dev/null we'll see what happens in about 15 minutes i'll give it.
    is there a way to restart my cronjobs like i do all the other services

    I know its not the scripts cause I have the same ones installed over like 8 other accounts on same vps, its just this one.

    when i do crontab -e in ssh it only gives me one cron and dont list any crons that are set at all. Should it list all of the cronjobs that are running or setup to run.

    Thanks again
    Shannon
     
  6. WebScHoLaR

    WebScHoLaR Well-Known Member

    Joined:
    Dec 14, 2005
    Messages:
    511
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    Planet Earth
    You can stop/start the crond daemon as :

    service crond stop/start

    All cron files are located at /var/spool/cron/ directory.Inside this directory you will find the files with the same name as of the account username.

    You can check the cron jobs setup for a specific account by:

    crontab -e -u username
     
  7. dalem

    dalem Well-Known Member
    PartnerNOC

    Joined:
    Oct 24, 2003
    Messages:
    2,577
    Likes Received:
    40
    Trophy Points:
    48
    Location:
    SLC
    cPanel Access Level:
    DataCenter Provider
    service crond restart

    if you are looged in via root it would be

    crontab -u username -e
    to edit users cron


    crontab -e from root should look somthing like this

    10 0 * * * /scripts/upcp
    0 1 * * * /scripts/cpbackup
    */15 * * * * /usr/local/cpanel/whostmgr/bin/dnsqueue > /dev/null 2>&1
    2,58 * * * * /usr/local/bandmin/bandmin
    0 0 * * * /usr/local/bandmin/ipaddrmap
    0 6 * * * /scripts/exim_tidydb > /dev/null 2>&1
    */5 * * * * /usr/local/cpanel/bin/dcpumon >/dev/null 2>&1
     
  8. shanit

    shanit Well-Known Member

    Joined:
    Dec 18, 2005
    Messages:
    46
    Likes Received:
    0
    Trophy Points:
    6
    this is what mine looks like when i run crontab -e
    0 6 * * * /scripts/exim_tidydb > /dev/null 2>&1


    think i have a problem
     
  9. dalem

    dalem Well-Known Member
    PartnerNOC

    Joined:
    Oct 24, 2003
    Messages:
    2,577
    Likes Received:
    40
    Trophy Points:
    48
    Location:
    SLC
    cPanel Access Level:
    DataCenter Provider
    you could run a

    /scripts/upcp --force

    and it might add everything back
    some of them might be missing if your not running the services
     
  10. shanit

    shanit Well-Known Member

    Joined:
    Dec 18, 2005
    Messages:
    46
    Likes Received:
    0
    Trophy Points:
    6
    ok that added this
    0 6 * * * /scripts/exim_tidydb > /dev/null 2>&1
    43 0 * * * /scripts/upcp
    0 1 * * * /scripts/cpbackup
    */15 * * * * /usr/local/cpanel/whostmgr/bin/dnsqueue > /dev/null 2>&1
    */5 * * * * /usr/local/cpanel/bin/dcpumon >/dev/null 2>&1


    now i dont need to install nothing again like ioncube ornothing right? cause I'm not sure if this was like a rebuild or what :) but it added stuff back BUT the cron still wont run I dont get it

    thanks
    Shannon
     
  11. dalem

    dalem Well-Known Member
    PartnerNOC

    Joined:
    Oct 24, 2003
    Messages:
    2,577
    Likes Received:
    40
    Trophy Points:
    48
    Location:
    SLC
    cPanel Access Level:
    DataCenter Provider
    what do your cron log say
     
  12. shanit

    shanit Well-Known Member

    Joined:
    Dec 18, 2005
    Messages:
    46
    Likes Received:
    0
    Trophy Points:
    6
    Ok this is what is in the /usr/local/cpanel/logs/error_log
    well that one is totally blank nothing there

    and when I go this route to
    /var/spool/cron/username the logs say this
    MAILTO="username"
    5 * * * * lynx --dump http://xx.com/scripts/admin/cronjobs.php > /dev/null
    */10 * * * * lynx --dump http://www.xx.com/scripts/admin/cronjobs.php

    I set it up 2 different ways to see if i could get one to work one with out the > /dev/null and one with it.

    if you know anywhere else for errors please let me know Thanks so much
    Shannon
     
  13. Izzee

    Izzee Well-Known Member

    Joined:
    Feb 6, 2004
    Messages:
    469
    Likes Received:
    0
    Trophy Points:
    16
    The cron log is at:
    /var/log/cron

    I think you may have to put the path to lynx like you did in your first post.
    */10 * * * */usr/bin/lynx --dump http://www.XX.com/scripts/admin/cronjobs.php > /dev/null

    Make sure the entry is in /var/spool/cron/username

    If not then go through the motions in cPanel to add it which might be easier than using the command line edit.

    You can, as admin, go to the users cpanel from within WHM by clicking on Account Information >> List Accounts then under column cPanel click on the logo icon. Then add the entry in the Cron Jobs either in the advanced mode or the Standard mode which ever you prefer.

    Tip: If you are tab browsing then use another tab by right clicking the logo icon.

    Make sure the cron daemon is running and there is not much else to it really.
    # /etc/rc.d/init.d/crond status
    crond (pid nnnn) is running...

    or
    crond is stopped

    if stopped run
    # /etc/rc.d/init.d/crond restart
    Stopping crond: [ OK ]
    Starting crond: [ OK ]


    Either started or stopped you can run the restart command again just in case.

    crond usage: /etc/rc.d/init.d/crond {start|stop|status|reload|restart|condrestart}

    :)
     
    #13 Izzee, Dec 26, 2005
    Last edited: Dec 26, 2005
Loading...

Share This Page