C4talyst

Well-Known Member
Jun 21, 2008
55
0
56
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?
 

cPanelDon

cPanel Quality Assurance Analyst
Staff member
Nov 5, 2008
2,544
13
268
Houston, Texas, U.S.A.
cPanel Access Level
DataCenter Provider
Twitter
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
 

DeepXP

Well-Known Member
Feb 20, 2005
68
7
158
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..
 

cPanelDon

cPanel Quality Assurance Analyst
Staff member
Nov 5, 2008
2,544
13
268
Houston, Texas, U.S.A.
cPanel Access Level
DataCenter Provider
Twitter
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?
 

DeepXP

Well-Known Member
Feb 20, 2005
68
7
158
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

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
 

cPanelDon

cPanel Quality Assurance Analyst
Staff member
Nov 5, 2008
2,544
13
268
Houston, Texas, U.S.A.
cPanel Access Level
DataCenter Provider
Twitter
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.
 

DeepXP

Well-Known Member
Feb 20, 2005
68
7
158
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.
 

cPanelDon

cPanel Quality Assurance Analyst
Staff member
Nov 5, 2008
2,544
13
268
Houston, Texas, U.S.A.
cPanel Access Level
DataCenter Provider
Twitter
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
 

DeepXP

Well-Known Member
Feb 20, 2005
68
7
158
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
 

isdoo

Active Member
Mar 25, 2011
32
0
56
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.