Setting up cronjobs

hello all,

I have a shell script and I need to schedule it in crontab, I have the next line:

06 16 * * 1,2,3,4,5 /usr/bin/ksh /path/path/name.sh > /path/path/name.log

first, I scheduled from Monday to Friday but it doesn't run, the log file is empty.. any idea why is causing this? :confused:

note: my shell works if I run it manually.

Thanks!

is crond running?

could you explain me crond?, I am new on this and I haven't heard about crond, how can I check if crond is running? thank you

crond is the service that runs the cronjobs. If its not running your jobs wont run either.

What OS you using?

Post output of:

# ps aux | grep crond

SunOS 5.8 Generic_117350-35 sun4u sparc SUNW,Netra-T12

$ ps aux | grep crond
usage: ps [ -aAdeflcjLPy ] [ -o format ] [ -t termlist ]
[ -u userlist ] [ -U userlist ] [ -G grouplist ]
[ -p proclist ] [ -g pgrplist ] [ -s sidlist ]
'format' is one or more of:
user ruser group rgroup uid ruid gid rgid pid ppid pgid sid taskid
pri opri pcpu pmem vsz rss osz nice class time etime stime
f s c lwp nlwp psr tty addr wchan fname comm args projid project

Ok, Im not sure of the command in SunOS.

you need to figure out how to the the ps command

This is what works on HP-UX:

# ps -ef | grep crond

But not sure if thats correct on SunOS

I tried the last command and I got this:

$ ps -ef | grep crond
user 19096 7926 0 17:44:58 pts/4 0:00 grep crond

OK, that shows crond is NOT running.

also try (on HP-UX its cron vs crond):

# ps -ef | grep cron

Lookup how to start crond.

might be:

# /etc/init.d/cron start

Find your init.d directory and look for cron or crond

but my user is not root, does it matter?, I have another user and It seems that I do not have privileges:

$ cron start
! you are not authorized to use cron. Sorry. Mon Nov 17 17:57:32 2008
! ******* CRON ABORTED ******** Mon Nov 17 17:57:32 2008

Yes you must have root access.

other thing, I did a test with a simple shell script like: touch TEST that comand I put in a file .sh I scheduled in crontab and the file TEST was created. I don't know why with my other shell script the cron is not working. =/

do you have other suggestion? thanks.

Well it appears that cron IS running.

Check the cron logfile, if you have permission. Since you are not root ask your sysadmin for help.

Yes, I have permission, my user appears at at.allow file.
Any idea?

my crontab has been executed successfully, I had to add this line:
export PATH=$PATH:$ORACLE_HOME/bin
to my shell script.

Note: My shell was running a sql script.

Thanks.