The log file shows you what and when something is executed. For instance, you might be running or submitting a command or procedure. From what I understand, an email is sent when the crontask has completed, which also shows the result, such as the termianl output or error, if any.

You can use standard output and standard error variables in this case to get the necessary details appended in a log file. Find below the example:

0,10,20,30,40,50 * * * * Script name; date >> log file name 2>&1

It will append the standard output as well as error with date time in the log file. Hope it helps. Triggering the job from cron entry is the utility of cronjob. It is advisable to check the details of jobs from the log file.

I just want to know my job completed successfull or not. Mean, i only know my cron job completed sucessful or not when i do select on my database.

Thanks

cron is just a job scheduler. It's not his responsibility to check or log the success or failure of any particular operation within your job. That's why you need to write your job in such a way as to do its own logging and interpreting of errors.

The cron log simply tells whether or not a particular cron process executed. What does "successful" in such output really tell you? Does it mean that the process was executed successfully as it indicates, or does it mean the task was executed successfully? From what I understand, the cron process may have run successfully, but it does not necessarily mean the task was successful too.

Under Linux, the cron log (/var/log/cron) shows what cron jobs got executed, including data and time, owner and command, but it does not explicitly report "failed" or "successful". You have to check the cron output to see if your cron task was successful. By default, all output is send to the mail facility, or you can use your own mechanism (2>&1) and redirect standard output including standard error output to a log file as previously explained.

Yes, but if you look into AIX. It does tell ues know the cron job completed sussecfullu or not

Doesn't have anything to do with any "magic" you think is being peformed by AIX's cron vs. anyone else's.

As we've been trying to explain, cron is just a scheduler. It schedules tasks and submits those tasks for execution at the scheduled time. It has now knowledge of what those tasks are expected to do and it certainly has no knowledge of whether or not those tasks actually accomplished their tasks in a manner that you or anyone else might consider "successful". The only thing cron would consider a failure is if some process returned an exit code greater than zero.

You send me an email requesting that I do something.

The system reports back that it successfully delivered the email.

The system has no way of knowing or reporting if I did what you asked me to do in the email.

scheduling tasks in cron is no different.

If I start a sqlplus session and issue a sql statement that fails, sqlplus will report that with a message, but sqlplus itself still exits with a zero (success) return code.

It is up to you to determine what constitutes success or failure in a given job. It is up to you to figure out how to make that determination within the job. It is up to you to determine how to notify someone of success or failure, within the job.

Have you looked at what cron does with any 'uncaptured' output .. output that is written to stdout or stderr? On my system (Oracle Linux) cron will capture that and send an email to a configured distribution list. But even at that, it is not a determination of failure or success, it is simply cron saying "hey, your job wrote these messages, here they are"