Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 12 of 12
  1. #1
    Member
    Join Date
    Jun 2008
    Posts
    48

    Question Can't add cron jobs

    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:

    Error"-":1: bad minute
    errors in crontab file, can't install.
    Any ideas?

  2. #2
    d_t
    d_t is offline
    Member
    Join Date
    Sep 2003
    Location
    Bucharest
    Posts
    239

    Default

    Crons are save in /var/spool/cron/user Edit file and correct errors.
    Joomla & Magento cPAddons
    Joomla 2.x added as cPanel Addon (free)

  3. #3
    cPanel Quality Assurance Analyst cPanelDon's Avatar
    Join Date
    Nov 2008
    Location
    Houston, Texas, U.S.A.
    Posts
    2,555
    cPanel/Enkompass Access Level

    DataCenter Provider

    Default

    Quote Originally Posted by C4talyst View Post
    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:
    Code:
    Error"-":1: bad minute
    errors in crontab file, can't install.
    Any ideas?
    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. #4
    Member DeepXP's Avatar
    Join Date
    Feb 2005
    Posts
    54

    Default

    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. #5
    cPanel Quality Assurance Analyst cPanelDon's Avatar
    Join Date
    Nov 2008
    Location
    Houston, Texas, U.S.A.
    Posts
    2,555
    cPanel/Enkompass Access Level

    DataCenter Provider

    Default

    Quote Originally Posted by DeepXP View Post
    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..
    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. #6
    Member DeepXP's Avatar
    Join Date
    Feb 2005
    Posts
    54

    Default

    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

    no crontab for xxx
    My WHM/cPanel version details are as below:

    cPanel 11.25.0-R43473 - WHM 11.25.0 - X 3.9
    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. #7
    Member DeepXP's Avatar
    Join Date
    Feb 2005
    Posts
    54

    Default

    Quote Originally Posted by echografilm View Post
    all the work you do is saved here /var/spool/cron/user there you can check for the errors and fix them
    I just did that and found this text in it:

    no crontab for xxx
    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. #8
    cPanel Quality Assurance Analyst cPanelDon's Avatar
    Join Date
    Nov 2008
    Location
    Houston, Texas, U.S.A.
    Posts
    2,555
    cPanel/Enkompass Access Level

    DataCenter Provider

    Default

    Quote Originally Posted by DeepXP View Post
    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?
    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. #9
    Member DeepXP's Avatar
    Join Date
    Feb 2005
    Posts
    54

    Default

    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. #10
    cPanel Quality Assurance Analyst cPanelDon's Avatar
    Join Date
    Nov 2008
    Location
    Houston, Texas, U.S.A.
    Posts
    2,555
    cPanel/Enkompass Access Level

    DataCenter Provider

    Default

    Quote Originally Posted by DeepXP View Post
    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.
    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. #11
    Member DeepXP's Avatar
    Join Date
    Feb 2005
    Posts
    54

    Default

    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. #12
    Member
    Join Date
    Mar 2011
    Posts
    17

    Default Re: Can't add cron jobs

    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.

Similar Threads & Tags
Similar threads

  1. Can't add cron jobs since 11.28.86 update
    By MaraBlue in forum cPanel and WHM Discussions
    Replies: 5
    Last Post: 03-17-2011, 07:28 AM
  2. Cron Jobs
    By tech6 in forum New User Questions
    Replies: 2
    Last Post: 10-10-2010, 11:06 PM
  3. Cron Jobs
    By atilimmedya in forum New User Questions
    Replies: 2
    Last Post: 08-23-2006, 05:51 AM
  4. Cron Jobs
    By 4402734 in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 10-20-2005, 01:34 PM
  5. cPanel cron jobs or cron.daily , cron.hourly , etc.?
    By spaceman in forum cPanel and WHM Discussions
    Replies: 6
    Last Post: 01-01-2004, 07:16 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube