cancel
Showing results for 
Search instead for 
Did you mean: 

unable to edit crontab

jeevarajkn
Frequent Advisor

unable to edit crontab

Hi Guru,s

OS-HP UX 11.23

Getting error while executing crontab -e command for root also.Its not working for any of the user.

crontab -e
crontab: can't create your crontab file in the crontab directory.

I checked /var/adm/cron/cron.allow files and semms ok.

/var/spool/cron/crontabs>ll
total 48
-rwxr-xr-x 1 root dba 220 Mar 15 22:22 bkpadm
-rwxr-xr-x 1 root dba 425 May 12 17:29 oracle
-r-------- 1 root sys 434 May 26 11:40 root


ls -ld crontabs
drwxr-xr-x 2 bin bin 96 May 26 11:47 crontabs


please help me to resolve the issue

6 REPLIES
Michal Kapalka (mikap)
Honored Contributor

Re: unable to edit crontab

Steven E. Protter
Exalted Contributor

Re: unable to edit crontab

Shalom,

Most likely cause of not being able to create the file is the path does not exist.

pwd in the crontabs directory.

The locatoin looks good.

Can you post cron.allow so we can diagnose?

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
SoorajCleris
Honored Contributor

Re: unable to edit crontab

It seems your EDITOR variable is not set properly .. Please check

#echo $EDITOR

if it is not vi

#export EDITOR=vi

Please let me know the progress
"UNIX is basically a simple operating system, but you have to be a genius to understand the simplicity" - Dennis Ritchie
jeevarajkn
Frequent Advisor

Re: unable to edit crontab

Hi All
Pleadse find the required output

UAEMFQDDCBDBD01:/var/spool/cron/crontabs>ls -lrt
total 48
-rwxr-xr-x 1 root dba 220 Mar 15 22:22 bkpadm
-rwxr-xr-x 1 root dba 425 May 12 17:29 oracle
-rwxr-xr-x 1 root sys 434 May 26 11:40 root


UAEMFQDDCBDBD01:/var/adm/cron>cat cron.allow
root
adm
uucp
oracle
bkpadm


no cron.deny file


UAEMFQDDCBDBD01:/var/adm/cron>echo $EDITOR
vi
Dennis Handly
Acclaimed Contributor

Re: unable to edit crontab

The link that mikap gave points to my reply where the user has messed up the permission of crontab, SETUID root. What is yours?
You may have to use "swverify \*" to see what else is broken.
Suraj K Sankari
Honored Contributor

Re: unable to edit crontab

Hi,
>>no cron.deny file

If cron.allow is exist and cron.deny is not exist then all the user present cron.allow then all users listed in the cron.allow file can use cron.

>>crontab: can't create your crontab file in the crontab directory.
this means you are not login as root or the user you have login is not having the permission to edit crontab.

login as a root and then try

Suraj