Following this discussion (link), here’s the cheap’n’simple way to do that–explained in detail.
Step by step:
1. Create /tmp/reports directory.
2. Create timetables for reports you need, like usual:
3. Repeat creating timetable for every daily report you need to be sent.
4. Create a shell script daily_email.sh in /export/home/cms:
Change directory to /export/home/cms and open a new file in vi editor:
Press “a” to add input, copy the script text from a quote below and insert it into terminal window using Shift-Insert keys:
The script is as following:
for i in `ls -1 /tmp/reports` ; do mailx -s "fresh report $i" firstname.lastname@example.org < /tmp/reports/$i ; done
It kinda goes without saying that you would need to change “email@example.com” for an actual address of whomever it may concern. :)
Press Esc, then type in “:wq” and press Enter:
This command will save the file and quit vi. Next you need to make this script executable by running “chmod” command like this:
5. Put this script in crontab by issuing “EDITOR=vi crontab -e” as root:
The last line is what you need:
10 6 * * * [ –x /export/home/cms/daily_email.sh ] && /export/home/cms/daily_email.sh
It tells your CMS server to run the script at 6:10am every day, you can change the time if you don’t like it. Save and quit with “:w!” and “:q” commands respectively.
6. Check that sendmail is running:
If it’s not, run “/etc/init.d/sendmail start” and check again.
Considering that this requires like half a minute for every report you need to run daily to set up and practically zero maintenance, I fail to see any reason to pay Avaya $$ for their services.CMS, email, reporting