1834185 Members
2654 Online
110064 Solutions
New Discussion

Re: cron and sendmail

 
Nago
Advisor

cron and sendmail

Greetings all,
I need your help please. How do i get started with scheduling a job using crontab? Also I would like to have the output of the job to be sent to my outlook mailbox. So how do i set up mail in HP-UX.
Thanks for your kind response.
Regards,

Nago
2 REPLIES 2
Balaji N
Honored Contributor

Re: cron and sendmail

hi,

first i would suggest you to read the man pages for crontab. also get a good sysadmin book and read.

now for your question.

1. edit crontab
crontab -e

2. add entry for your scheduled job. create a script which contains your job and
add it. It contains six fields the time related fields in the order (copy paste frm man page) are given below. the sixth field is the absolute path to your script.

++++++++++++++
The time and date fields are:

field allowed values
----- --------------
minute 0-59
hour 0-23
day of month 1-31
month 1-12 (or names, see below)
day of week 0-7 (0 or 7 is Sun, or use names)

A field may be an asterisk (*), which always stands for ``first-last''.
++++++++++++

3. as a part of your script itself you can redirect your output to a mail id or pipe the output in the crontab to mail.

4. setup sendmail to relay all mails to your mail server. this is done by changing the entry which contains the macro DS in /etc/sendmail.cf file to the ip address or hostname of your mail server.

DS

to

DSmailserver.name.com

5. restart sendmail.


if you need more info, revert with specifics.

hth
-balaji


Its Always Important To Know, What People Think Of You. Then, Of Course, You Surprise Them By Giving More.