LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-24-2011, 08:38 AM   #1
fcocnews
LQ Newbie
 
Registered: Jun 2011
Posts: 6

Rep: Reputation: Disabled
Trying to create crontab - bad minutes error


I am trying to create a crontab and entered the following code (all on one line)

*/5****/usr/bin/php/-f/ services8/webpages/util/f/c/fcoc01.site.aplus.net/fcocnews.com/public/testing/admin/cron/cron.php

When I try to save I get error message:

crontab: installing new crontab
"/tmp/crontab.XXXXTNfOgg":-2: bad minute

Based on what I have read I can't see where the error is.

Any suggestions.

Be gentle I'm still a newbie

Rick
 
Old 06-24-2011, 08:41 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976
you might want a little whitespace in the string... what's with it all being one "word" ???


*/5 * * * * /usr/bin/php -f /services8/webpages/util/f/c/fcoc01.site.aplus.net/fcocnews.com/public/testing/admin/cron/cron.php

I guess...

if this is going in /etc/crontab the format is a little different:


*/5 * * * * root /usr/bin/php -f /services8/webpages/util/f/c/fcoc01.site.aplus.net/fcocnews.com/public/testing/admin/cron/cron.php

to explicitly run it as root.
 
Old 06-24-2011, 09:54 AM   #3
fcocnews
LQ Newbie
 
Registered: Jun 2011
Posts: 6

Original Poster
Rep: Reputation: Disabled
I added "root" as suggested but received the same error message.

crontab: installing new crontab
"/tmp/crontab.XXXXbB1MsK":-2: bad minute
errors in crontab file, can't install.

Any more suggestions as what I should check.

Rick
 
Old 06-24-2011, 11:07 AM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976
Well it's clearly complaining about the minutes, and that's the first parameter, "*/5" is a valid minute, so that can't be what the first whitespace delimited field actually says.
 
Old 06-24-2011, 11:21 AM   #5
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390
Hi,

Could it be that that one long line was cut into 2 lines? It should be one long line.

Hope this helps.
 
Old 06-24-2011, 11:53 AM   #6
fcocnews
LQ Newbie
 
Registered: Jun 2011
Posts: 6

Original Poster
Rep: Reputation: Disabled
Chris

I went back in and erased whatever was in the crontab, crontab -r, and rekeyed the command starting at the first character to the left. Went to save and received the same message.

I am using vi as the editor. Could the problem be that the editor?

Rick
 
Old 06-24-2011, 11:54 PM   #7
speck
Member
 
Registered: Nov 2001
Location: US
Distribution: Slackware 14.2
Posts: 354

Rep: Reputation: 93
Mentioned a couple times already, but are you putting spaces between the asterisks?

Code:
*/5 * * * * /usr/bin/php -f /services8/webpages/util/f/c/fcoc01.site.aplus.net/fcocnews.com/public/testing/admin/cron/cron.php
 
Old 06-25-2011, 08:22 AM   #8
fcocnews
LQ Newbie
 
Registered: Jun 2011
Posts: 6

Original Poster
Rep: Reputation: Disabled
There are no spaces between the astericks. The input is flush left

Rick

Last edited by fcocnews; 06-25-2011 at 08:23 AM.
 
Old 06-25-2011, 09:31 AM   #9
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976
there are no spaces.

So when we've said TWICE now that there need to be spaces...??? TWICE?!
 
Old 06-25-2011, 09:58 AM   #10
fcocnews
LQ Newbie
 
Registered: Jun 2011
Posts: 6

Original Poster
Rep: Reputation: Disabled
Sorry

I though the previous responses were asking if I had put spaces not saying I needed to put spaces.

speck - thanks for giving me the proper coding

Rick
 
Old 06-25-2011, 10:46 AM   #11
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976
I think you'll find I gave you the same line 26 hours ago...
 
1 members found this post helpful.
Old 06-25-2011, 11:09 AM   #12
fcocnews
LQ Newbie
 
Registered: Jun 2011
Posts: 6

Original Poster
Rep: Reputation: Disabled
Again I thought your comment "you might want a little whitespace in the string" was a "nice to do" not a "you need to do"

Again

thanks for you help
 
Old 11-13-2014, 12:40 AM   #13
filippos
LQ Newbie
 
Registered: May 2007
Posts: 14

Rep: Reputation: 0
Same happened to me and the problem was the parameter section
Its wrong to leave null a parameter :
PARAMETER=
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] How can I get crontab to execute process every 10 minutes? keevill Linux - Newbie 4 01-31-2011 09:56 PM
bad minute error adding a crontab job htamayo Linux - Newbie 7 03-15-2010 09:56 AM
Crontab question (Every few minutes after a certain time) Norwood Linux - Newbie 5 03-08-2010 03:41 PM
How to start crontab every 5 minutes? cola Linux - General 15 12-31-2009 12:00 PM
Crontab every 10 minutes Neorio Linux - General 1 11-19-2003 12:46 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:42 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration