LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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, 07: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, 07:41 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
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, 08: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, 10:07 AM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
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, 10:21 AM   #5
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
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, 10: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, 10:54 PM   #7
speck
Member
 
Registered: Nov 2001
Location: US
Distribution: Slackware 14.2
Posts: 375

Rep: Reputation: 115Reputation: 115
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, 07: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 07:23 AM.
 
Old 06-25-2011, 08:31 AM   #9
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

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

So when we've said TWICE now that there need to be spaces...??? TWICE?!
 
Old 06-25-2011, 08: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, 09:46 AM   #11
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
I think you'll find I gave you the same line 26 hours ago...
 
1 members found this post helpful.
Old 06-25-2011, 10: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-12-2014, 11:40 PM   #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



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 08:56 PM
bad minute error adding a crontab job htamayo Linux - Newbie 7 03-15-2010 08:56 AM
Crontab question (Every few minutes after a certain time) Norwood Linux - Newbie 5 03-08-2010 02:41 PM
How to start crontab every 5 minutes? cola Linux - General 15 12-31-2009 11:00 AM
Crontab every 10 minutes Neorio Linux - General 1 11-18-2003 11:46 PM

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

All times are GMT -5. The time now is 08:53 PM.

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
Open Source Consulting | Domain Registration