1831356 Members
3036 Online
110024 Solutions
New Discussion

Crontab for users

 
SOLVED
Go to solution
Carlos Vanegas
Occasional Advisor

Crontab for users

Hi,I want to my user oracvv use the crontab and I added in /var/adm/cron/cron.allow, I use the crontab -e and insert my process, but when I tryed to save have the next error:
/var/tmp/aaaa08577" 1 line, 19 characters
crontab: can't create your crontab file in the crontab directory.

what I need to do??
Thanks
6 REPLIES 6
Steven Sim Kok Leong
Honored Contributor
Solution

Re: Crontab for users

Hi,

Check that the ownership and permissions of the following files and directories are correct. Note that the setuid bit of /usr/bin/crontab must be set.

# ll `which crontab`
-r-sr-xr-x 1 root bin 40336 May 31 2001 /usr/bin/crontab
# ll -d /var/spool/cron
dr-xr-xr-x 7 bin bin 1024 Apr 20 06:48 /var/spool/cron
# ll -d /var/spool/cron/crontabs
dr-xr-xr-x 2 bin bin 96 Apr 9 07:40 /var/spool/cron/crontabs

Hope this helps. Regards.

Steven Sim Kok Leong
Helen French
Honored Contributor

Re: Crontab for users

Some thoughts:

1) Is this happening to only one user, then check the permission of crontab file and crontab directories. (/usr/bin/crontab, /var/adm/cron and /var/spool/cron)
2) Instead of creating with crontab -e, first edit a file and then use the command:

# crontab cronfile
3) If you don't require files, then you can erase the content of /var/tmp. These are temp files normally.
Life is a promise, fulfill it!
Jeff Schussele
Honored Contributor

Re: Crontab for users

Hi Carlos,

Initial creation of that user's cron file should be by root

#crontab -e oracvv

From that point forward then the oracvv user can edit it.

HTH,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
MANOJ SRIVASTAVA
Honored Contributor

Re: Crontab for users

Hi Carlos


To enable cron you should have the following 2 things ,

1. /var/adm/cron/cron.allow should ahve th user name.

2./usr/spool/cron/crontbs/ should ahve a empty file with the naem as that of the user . This file should be atleast read only .


I think you dont have that file .


Manoj Srivastava
S.K. Chan
Honored Contributor

Re: Crontab for users

I have just tested this myself ..
1) Edit /var/adm/cron/cron.allow (as root) and put my username in it.
2) Run "crontab -e" as myself and it's fine.
The cron file got created in /var/adm/spool/cron/crontabs. So most likely in your case it would be permission as what Steven had mentioned.

Jeff Schussele
Honored Contributor

Re: Crontab for users

Hi S.K.,

Yes..I tested also and strangely on the first system I did so I got Carlos' symptom. Just now on the 2nd system it worked as you stated.
Both systems, same perms/ownership, so no diff there. Now back on the first system, after removing the newly created cron file, the normal user CAN create new cron files......strange, it's as if cron had to be "bounced".

Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!