Crontab Mistake!!!


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Crontab Mistake!!!
# 1  
Old 07-16-2003
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.
# 2  
Old 07-16-2003
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  
Old 07-17-2003
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  
Old 07-17-2003
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  
Old 07-17-2003
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
 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

If condition on shell not working , not sure what is the mistake I am doing?

I have a requirement to perform specific set of tasks based on server , So I want to have the condition(s) defined based on server. Here is the script I came up with and I have read multiple blogs and couldn`t find any mistake from my script. Can you guide on what I am overlooking here ? ... (2 Replies)
Discussion started by: Varja
2 Replies

2. Programming

Archive script spot a mistake?

#!/bin/bash source=/to_be_archived dest=/archived echo "is this archive for an audio tar press (t) or an audio directory press (d)" read option case $option in d) cd "$source" echo "please specify full path to directory you want to be... (6 Replies)
Discussion started by: robertkwild
6 Replies

3. Shell Programming and Scripting

Strange type mistake?!

Hi, I want to start MY_PROGRAM in a bash script with additional parameters given in the CONFIGURATION_ARRAY. IFS="'" CONFIGURATION_ARRAY=( '-N 0 -m 0' '-N 0 -m 1' ) for configuration in ${CONFIGURATION_ARRAY} do //DEBUG N=${configuration%-*} //-N 0 M=-${configuration##*-} //-m 0... (5 Replies)
Discussion started by: xraystorm
5 Replies

4. UNIX for Dummies Questions & Answers

Can anyone help me to spot my mistake?

Hi there can anyone help me to spot my mistake and please explain why it appears My code : #!/usr/bin/gawk -f BEGIN { bytes =0} { temp=$(grep "datafeed\.php" | cut -d" " -f8) bytes += temp} END { printf "Number of bytes: %d\n", bytes } when I am running ./q411 an411 an411: ... (6 Replies)
Discussion started by: FUTURE_EINSTEIN
6 Replies

5. Red Hat

Changing Desktop Environment by mistake

Hi, I'm using fedora 15, my defualt DE is XFCE I once saw that there is a option in startup DE's that I can select and it was OPENBOX. I just wanted to test it. but after choosing it as my DE here I am. I have just access to terminal, firefox.. what's in my desktop. there is no panel here. I... (0 Replies)
Discussion started by: hoseinit
0 Replies

6. UNIX for Dummies Questions & Answers

Probably some stupid mistake...

Hi everyone ! I have a file wich look like this : >Sis01 > Sis02 ... >Sis44 I want to separe each paragraphe in a different file, so I decide to use the "FOR" loop + sed. for f in {01..44} do (5 Replies)
Discussion started by: sluvah
5 Replies

7. UNIX for Dummies Questions & Answers

Deleted the scripts in Crontab by mistake

hi, instead of typing crontab -e i gave crontab -r and hit enter. So i lost all my scripts. Is there any way to restore the deleted scripts? Please help me out Thanks Ajay (3 Replies)
Discussion started by: ajayakunuri
3 Replies

8. Shell Programming and Scripting

Is there any mistake in this code:

cat $1 | sort -n | uniq | $1 in other words, I sort the content of the file and put the ouput in the same file, is there any mistakes in this cshell code ??? (4 Replies)
Discussion started by: Takeeshe
4 Replies

9. AIX

Did a Mistake with HACMP

Hi, I needed space on a FS, and when I've added the space on the filesystem, I did it trough the regular smitty fs inteface and not with smitty cl_lvm. Can someone help me to repair the situat before a faileover happen ? Thanks for your help,:mad: (13 Replies)
Discussion started by: azzed27
13 Replies
Login or Register to Ask a Question