1752631 Members
5802 Online
108788 Solutions
New Discussion

Send Mail Using crontab

 
Mohammad Sanaullah
Frequent Advisor

Send Mail Using crontab

Dear All, we have the sendmail running on the server.
I have one script which will get the O/P in a file and I want that file to be sent to one user, How would I make entry in crontab so that script will run on specified time and the O/P file will be mailed to the user as an attachement.

Please let me know the sentex entry in the cron. (I would like to run script daily, 9:00 AM and send the O/P file to user)


Thanks for the support in advance.
Alive
1 REPLY 1
SKR_1
Trusted Contributor

Re: Send Mail Using crontab

Include the sendmail entry inside the script.

cat filename| mailx -r Unix_Admin -s "Name of the output" ID

crontab -e

00 09 * * * scriptname

Thanks

SKR