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.

Can't add cron jobs

Discussion in 'General Discussion' started by C4talyst, Feb 1, 2010.

  1. C4talyst

    C4talyst Well-Known Member

    Joined:
    Jun 21, 2008
    Messages:
    56
    Likes Received:
    0
    Trophy Points:
    6
    Hello,

    I'm trying to add a cron job to a domain hosted on my WHM/cPanel. From within cPanel for the domain in question, I use the drop-down menus and set my preferred times, then I enter the path to the script I want to run:

    /home/user/bin/script.sh

    I then get the following error when I attempt to save it:

    Any ideas?
     
  2. d_t

    d_t Well-Known Member

    Joined:
    Sep 20, 2003
    Messages:
    243
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Bucharest
    Crons are save in /var/spool/cron/user Edit file and correct errors.
     
  3. cPanelDon

    cPanelDon cPanel Quality Assurance Analyst
    Staff Member

    Joined:
    Nov 5, 2008
    Messages:
    2,557
    Likes Received:
    7
    Trophy Points:
    38
    Location:
    Houston, Texas, U.S.A.
    cPanel Access Level:
    DataCenter Provider
    Twitter:
    If there is a preexisting error in the user's crontab this must be corrected. If you share with us the contents of the user's crontab that will help so the settings may be checked.

    Via root SSH access, either of the following commands may be used to list the contents:
    Code:
    # crontab -l -u username
    # cat /var/spool/cron/username
     
  4. DeepXP

    DeepXP Well-Known Member

    Joined:
    Feb 20, 2005
    Messages:
    65
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Internet
    cPanel Access Level:
    Root Administrator
    Actually, I am also getting the exact same error,

    "crontab -l -u username" does not retrieve anything as there are no cron jobs for that user.

    I am trying to set following for the cron job (at interval of every 5 minute)

    Code:
    wget -O/dev/null http://example.com/cron/index.php
    Any kind of inputs, suggestions appreciated..
     
  5. cPanelDon

    cPanelDon cPanel Quality Assurance Analyst
    Staff Member

    Joined:
    Nov 5, 2008
    Messages:
    2,557
    Likes Received:
    7
    Trophy Points:
    38
    Location:
    Houston, Texas, U.S.A.
    cPanel Access Level:
    DataCenter Provider
    Twitter:
    I attempted to trigger the message using same command but I was unable to reproduce the issue.
    Code:
    # crontab -l -u $username | tail -n1
    0 0 * * * wget -O/dev/null http://example.tld/cron/index.php
    What is your full cPanel version and build number?
     
  6. DeepXP

    DeepXP Well-Known Member

    Joined:
    Feb 20, 2005
    Messages:
    65
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Internet
    cPanel Access Level:
    Root Administrator
    Thanks for the reply, I checked with the hosting support but they told me, there was some text already in my crontab file, due to which it was causing the issue. (And they fixed it too)

    I am not sure, how the text got into that file, (As when I had checked, I couldn't find anything in it)

    I just tried again with another domain and I was able to replicate the same issue. Again, I couldn't find anything in the crontab of that user.

    It showed me following

    My WHM/cPanel version details are as below:

    Let me know if you want me to check anything specific on the server, I can do it as I have the root access to it.

    Regards,
    Deep
     
  7. DeepXP

    DeepXP Well-Known Member

    Joined:
    Feb 20, 2005
    Messages:
    65
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Internet
    cPanel Access Level:
    Root Administrator
    I just did that and found this text in it:

    I removed that line and then I was able to add the cron job properly.. Thanks :)

    I think this may be due to some bug?
     
  8. cPanelDon

    cPanelDon cPanel Quality Assurance Analyst
    Staff Member

    Joined:
    Nov 5, 2008
    Messages:
    2,557
    Likes Received:
    7
    Trophy Points:
    38
    Location:
    Houston, Texas, U.S.A.
    cPanel Access Level:
    DataCenter Provider
    Twitter:
    What methods are being used to edit user crontabs? Are any methods being used other than the built-in cron jobs editor in cPanel?

    When creating a new cPanel account, such as for testing purposes, then accessing cPanel (logged-in as the new user and not via root/WHM), are you still able to reproduce the issue?

    If the issue occurs on a new cPanel account, or if you have a definitive way to reproduce the issue on any cPanel account, please let us know the steps being used. Being able to reproduce the issue will help to pinpoint where the cause may stem from.

    Please note that suspected bugs should be reported via our ticket system to ensure proper attention, investigation, and internal progress tracking; please see the link in the upper-right-corner of forums, labeled Bugs.
     
  9. DeepXP

    DeepXP Well-Known Member

    Joined:
    Feb 20, 2005
    Messages:
    65
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Internet
    cPanel Access Level:
    Root Administrator
    Can you try this test case?

    Move any accounts from Plesk control panel (via transfer option in WHM) and then try to add cron for those accounts.

    This is because, on my server, we have 3 accounts, 2 moved via Plesk (8.3) and 1 created directly via WHM.

    The problem is only with the accounts moved from Plesk. The same cron works perfectly fine with the other account.

    I hope it helps.
     
  10. cPanelDon

    cPanelDon cPanel Quality Assurance Analyst
    Staff Member

    Joined:
    Nov 5, 2008
    Messages:
    2,557
    Likes Received:
    7
    Trophy Points:
    38
    Location:
    Houston, Texas, U.S.A.
    cPanel Access Level:
    DataCenter Provider
    Twitter:
    Thank you for the information. If you still have a Plesk system where a transfer was performed from that exhibited the described issue please submit a support request so that we may assist with investigating the specific circumstances involved; it will be necessary to be able to examine the state of the cron tab information before and after it was packaged for transfer and subsequently restored on the destination server.

    When available, please send me a PM referencing this thread and your new ticket ID number so that I may follow-up internally. For reference, you may use either the aforementioned Bugs link or those in my forums signature to initiate a ticket submission, such as via the following resource: Additional Support Options
     
  11. DeepXP

    DeepXP Well-Known Member

    Joined:
    Feb 20, 2005
    Messages:
    65
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Internet
    cPanel Access Level:
    Root Administrator
    Ouch.. I deleted everything from the old plesk server and cancelled the plesk account.

    I will surely let you know (by PM and the ticket) once I get hold of another plesk account.

    Thanks for all the help, really appreciate it..

    Regards,
    Deep
     
  12. isdoo

    isdoo Active Member

    Joined:
    Mar 25, 2011
    Messages:
    32
    Likes Received:
    0
    Trophy Points:
    6
    Just for the record, I have exactly the same problem having had the conversion completed earlier today from Plesk 9.5.x

    I removed the line as above and was then able to create a cronjob.

    Another account had no issues.

    This account was manually brought over as the original attempt failed if that helps.
     
Loading...

Share This Page