Cron issue

When I list whats in cron -l its fine but when I try to -e edit it...it returns a number 309 can't you not edit cron this way with solaris 10? I can do it fine in sol 8 and 9.

export EDITOR="vi" is set in my profile

I am using BASH

$ sudo crontab -l
Password:
#ident  "@(#)root       1.21    04/03/23 SMI"
#
# The root crontab should be used to perform accounting data collection.
#
#
10 3 * * * /usr/sbin/logadm
15 3 * * 0 /usr/lib/fs/nfs/nfsfind
30 3 * * * [ -x /usr/lib/gss/gsscred_clean ] && /usr/lib/gss/gsscred_clean
#10 3 * * * /usr/lib/krb5/kprop_script ___slave_kdcs___

$ sudo crontab -e
309

you never mentioned what shell you are using?

The command you typed only works for ksh

do an echo $SHELL and see what it says.

if you are using bourne shell then the command is in complete

the complete command to export EDITOR or export anything under bourne shell is ..

EDITOR=vi;export EDITOR

Using sudo clear the EDITOR variable anyway.

309 is the number of characters in the crontab file as you are using the venerable default editor, ed.

Time to learn using ed or use a supported way to run privileged commands, as sudo is not part of Solaris 10.

Hi folks, I am new into working on UNIX. I wanted to run a .sh script daily(say at 10 AM). I came to know about setting a cron job for this. I did go through the tutorial on how to add a cron job. This is what i did:

vi update.cron

MAILTO="myid@yahoo.com"
0 10 * * * somescript.sh >>/dev/null 2>&1

then saved the file.
then i did,

crontab update.cron.

question is :

  1. will this work from any directory, which i'll be working in or i need to go to a specific directory?

2.when i execute crontab -l it does lists the added job but at the stipulated time the script/cron job does not run.Is there any other format or updation in any file that i should be doing.

Thanks a lot in advance

don't find you way throug funny means. Just follow procedure bro!. cd /var/spool/cron/crontabs
ls
more OR vi root (to edit root cronjobs)
to allow/disallow norm user from executing/creating cron,
cd /etc/cron.d/
vi cron.deny (to include a/cs that is to be denied etc)

I fixed this by adding lines below to my .profile. Thing that fixed it was TERM but EDITOR should be set also.

export TERM=vt100
export EDITOR=vi