Showing results for 
Search instead for 
Did you mean: 

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.
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