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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Impossible to edit crontab

Status
Not open for further replies.

mahalingam1

IS-IT--Management
Dec 7, 2007
75
0
0
Hi all, i have a problem when i try to edit an user crontab.

i login in a system and type crontab -e and i obtain:

$ crontab -e
122

and i can't edit the crontab. I can only edit the crontab if i'm a root user. I have checked for the permissions file and i found /etc/cron.deny, but inside this file does not appear the user which i login into the system.

Please anyone can help me???

Thanks in advance and best regards
 
You need to set the EDITOR as follows
EDITOR=vi;export EDITOR

and possibly the TERM
TERM=vt100;export TERM

You have picked up the old Solaris editor, which can be used with but is less friendly than vi
 
Hello marrow, i insert the lines that you told me and now i can edit the crontab.

Thank you very much for your information and your Quick response!!

Regards
 
I would add the exports to your .profile

Cheers

Marrow
 
I just do it

Thank you

Cheers

mahalingam
 
As an aside, I always recommend that people do not use crontab -e to edit their crontabs. I have seen instances where the edit was abandoned, or exited accidentally, in such a way that the crontab file was left corrupt (and therefore unuseable and difficult to troubleshoot) or empty (and then difficult to get the contents back).

So I recommend the following construct:
crontab -l > /tmp/cron.file
vi /tmp/cron.file
crontab /tmp/cron.file


I hope that helps.

Mike
 
Hi Mike, thank you for your information . Iwill take it in to account.

Thanks

Cheers


Mahalingam
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top