Operating System - Tru64 Unix
1751914 Members
5422 Online
108783 Solutions
New Discussion юеВ

Re: crontab problem

 
fergani
Advisor

crontab problem

Hi,
when I wanted to edit crontab file using the following command:-
#crontab -e
The crontab edit file was not opened.
please could anyone help me to fix my problem?
bye.

9 REPLIES 9
Rob Leadbeater
Honored Contributor

Re: crontab problem

Hi,

Crontabs are normally stored in this directory:

/var/spool/cron/crontabs

Assuming that you're trying to look at root's crontab, there should be a file there called root...

Hope this helps,

Regards,

Rob
Steven Schweda
Honored Contributor

Re: crontab problem

sizer -v
echo $EDITOR

> The crontab edit file was not opened.

What, exactly, does this mean? What _did_
happen? Did you get some error message?

> please could anyone help me to fix my
> problem?

It might be easier if you supplied some
basic, useful information. Did you try
reading this?:

man crontab
fergani
Advisor

Re: crontab problem

Hi Rob,

I looked for the following directory:-
/var/spool/cron/crontabs
I found all these files inside:-
.mrg..root .new..sys .proto..sys sys.new..adm .proto..adm adm uucp.new..cronuucp .proto..cronuucp cronuucp.new..root .proto..root root

the file you mentioned is among these file or not.
If it is among these file so what is the problem
bye.
Hi Steven,
the output of sizer -v command as following:-
# sizer -v
Compaq Tru64 UNIX V5.1 (Rev. 732); Mon Sep 20 10:17:40 EET 2010
echo $EDITOR
the output of echo $EDITOR is nothing appeared.

>What, exactly, does this mean? What _did_
>happen? Did you get some error message?

what exactly happened is when I used this command (crontab -e) to edit crontab file,the editor file did not appeared.
that what happened to me.
bye.
Dennis Handly
Acclaimed Contributor

Re: crontab problem

>the output of echo $EDITOR is nothing appeared.

You need to export EDITOR with the path to an editor that "crontab -e" can use.
Steven Schweda
Honored Contributor

Re: crontab problem

> You need to export EDITOR with the path to
> an editor that "crontab -e" can use.

Perhaps not. According to the "man" page:

http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/V51_HTML/MAN/MAN1/0073____.HTM

[...] The -e option invokes the editor
specified by the EDITOR environment variable,
or uses /usr/bin/vi by default. [...]


> [...] the editor file did not appeared.

So, the command appeared to do exactly
nothing?

> I found all these files inside:- [...]

ls -l /var/spool/cron/crontabs/root
Pieter 't Hart
Honored Contributor

Re: crontab problem

>>> The crontab edit file was not opened.
<<<

- what error did you get?
there may be a lock file from a previous session?

- if you try "crontab -l"
is there any cron entry listed?

- do you by chance run in a Cluster environment?
Rob Leadbeater
Honored Contributor

Re: crontab problem

> the file you mentioned is among these file or not.
> If it is among these file so what is the problem

Yes there's a file called root there, but again I am assuming that you're trying to edit root's crontab...

Can you cat the file ?

# cat root

Does that display what you're expecting to see ?

Is it possible someone accidentally deleted the crontab that you're trying to edit ?

It's quite easy to type crontab -r rather than crontab -e. (remove not edit).

Cheers,

Rob
fergani
Advisor

Re: crontab problem

Hi Rob,
>>Can you cat the file ?

# cat root

It display what I am expecting to see.

All its contents are there so what that means
and if corntab -e is deleted so how can I return it to its previous state.
bye
Rob Leadbeater
Honored Contributor

Re: crontab problem

OK, if "cat root" displays the crontab, then it hasn't been deleted.

The problem is therefore likely to be with your editor settings as previously suggested.

Try this:

# EDITOR=vi
# export EDITOR
# crontab -e

Cheers,
Rob