Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

crontab -e on SCO 8 1

Status
Not open for further replies.

copperslim

Technical User
Dec 13, 2002
101
GB
When ever I try to issue the command crontab -e as root. it does not edit the crontab but when I issue crontab -l I get the list.
What am I doing wrong as the crontab I want to edit was set-up by user root user.
 
When you issue the crontab -e, are you able so see the lines within the crontab, or do you just get a number? If that's the case, you may have to set your EDITOR variable to vi (set EDITOR=vi; export EDITOR) to enable you to use vi as the editor of the crontab. If that's not the problem, can you desribe in a little more detail wat you're doing and what sort of output your getting when trying to edit, please. Cheers.
 
This what happend
#set EDITOR=vi
# export EDITOR
# crontab -e

this is what am getting
ed /tmp/crontaba0072A
5575
 
Hmm, just checked one of my SCO boxes, and it doesn't appear to have an EDITOR variabe set, but still opens crontab in vi. What shell are you using, I'm using /bin/ksh? Looks to me as if you're using ed as the default editor for crontab, but I need to check how to change this. Get back to us re. the shell.
 
It hangs and also creates the /tmp/crontaba0072A in the /tmp. I can use vi to edit it in /tmp. Am confused and a job needs to run today @ 15.45 hours.
 
I don't think it's hanging, that's just default behaviour for ed - a little cryptic, I agree. Is this file created within /tmp exactly the same as the crontab? If so, I guess you could edit it and then issue a crontab <filename> so that it then becomes your crontab (and can be verified with a crontab -l that the change has been accepted). Not an ideal solution, I agree, but if I do find more out, I'll get back to you. When you say 15:45 hrs, are we talking BST? If not, others may well be along later who'll have the necessary info. for SCO.
 
i can edit the file in /tmp as it creates it. The more crontab -e commands I issue the more files it creates.

15:45 British Local Time.(GMT)

I have edit the cron vi /var/spool/cron/crontabs/root and saved it then issued the crontab -e command then crtl c hoping it will think I have edit it and saved. crontab -l verifies changes but does it mean it has taken effect?
 
crontab -e and then ctrl-C won't save the file, just abort the operation. If you're in vi, you have to save the file properly, ie after editing, press <esc>, then colon, then wq! to write and quit.

Incidentally, it may be that you have to specify the full vi pathename to get crontab to use it, ie:

set EDITOR=/usr/bin/vi ; export EDITOR

then try editing it.Maybe give that a go?
 
This is the result.

# set EDITOR=/usr/bin/vi
# export EDITOR
# crontab -e

ed /tmp/crontaba0005q
5575

it hangs, when I press entre I get ?
 
As I say, you're in ed (a precursor of vi, if you can imagine that!). Does your crontab -l show the new job that you've added? If so, when you get the above message, just type w <return> and then q <return> to get back to the command prompt. If not, then edit the temporary copy in /tmp and save it, then issue crontab /tmp/filename to activate it.

Incidentally, it's usually good advice not to edit the crontab directly using crontab -e, but I guess it's a bit late for that now! Hope this works.
 
Hmm. You might also try:

EDITOR=vi; export EDITOR

Then try your crontab -e again.

as the set seems superfluous (or possibly plain wrong!).
 
Thanx

EDITOR=vi; export EDITOR

Worked.

this is what I did
EDITOR=vi
# export EDITOR
# crontab -e
vi /tmp/crontaba000Jg

before I was getting ed /tmp/********* it changed to vi /tmp/******

Thanx
 
No problem. Should have got there sooner, but it is Monday morning! Cheers.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top