The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
crontab couldn't run through, help duke0001 UNIX for Advanced & Expert Users 10 02-05-2008 11:22 PM
help with crontab bob122480 Shell Programming and Scripting 3 01-22-2007 04:49 PM
Mistake in caculating Benchmark Average pja UNIX Benchmarks 0 02-27-2006 04:15 PM
Crontab lo-lp-kl UNIX for Dummies Questions & Answers 2 05-05-2005 03:21 PM

Closed Thread
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-16-2003
Registered User
 

Join Date: Nov 2002
Location: Raleigh, N.C.
Posts: 76
Crontab Mistake!!!

Hi. I hope someone can help me with this problem.
Being a novice to Unix, I editted my crontab directly
by typing " crontab -e ". Well, I needed to make some
changes so, I typed " crontab -r ". Now I have no crontab,
and I can't seem to get crontab to write a new file.

I' ve tried:

vi somefile
crontab somefile

I get the following errors:

crontab:
crontab: error on previous line; unexpected character found in line.

What might be my options from here. Any help will be greatly appreciated.
Forum Sponsor
  #2 (permalink)  
Old 07-16-2003
oombera's Avatar
Have a day :|
 

Join Date: Aug 2002
Location: Cleveland, OH
Posts: 804
Try this:
Code:
export EDITOR=vi  # or whatever editor you want to use
crontab -e        # edit your crontab file or create one if it doesn't exist
  #3 (permalink)  
Old 07-17-2003
davidg's Avatar
Registered User
 

Join Date: Jul 2003
Location: Holland
Posts: 207
Hi,

Please look at : /var/spool/cron/crontabs

Maybe you have a copy over here, else this file can be restored(root for root, oracle for oracle, etc)

>/var/spool/cron/crontabs/root
Will empty the crontab file !!! and makes you able to retry it all using "crontab -e"

Regs David
  #4 (permalink)  
Old 07-17-2003
Registered User
 

Join Date: Nov 2002
Location: Raleigh, N.C.
Posts: 76
Thanks for your suggestions. I have corrected the problem
by recreating a root crontab file and placing it in the /usr/spool/crontabs directory.

Now when I type "crontab -l" I see the new crontab file I created; however, when I try to overwrite my exisiting crontab file with the command "crontab somefile."

I still get the following error:

crontab: error on previous line; unexpected character found in line

Also, when I try editting the file with the crontab -e command I can't save the file without the creating multiple text lines after pressing the escape key. I am using the vi editor.
  #5 (permalink)  
Old 07-17-2003
davidg's Avatar
Registered User
 

Join Date: Jul 2003
Location: Holland
Posts: 207
Hi,

When doing a "cat <filename> | od -c"
You will get to see the octal and asci output of the file, you should now be able to find out what character is accidently put in the file.

Regs David
Google UNIX.COM
Closed Thread

Thread Tools
Display Modes




All times are GMT -7. The time now is 07:37 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0