Automaticall email tabanalys

Drammy

Member
Hi guys,

I would like to have DBUTILs -tabnalys stats emailed automatically every morning. Can anyone advise how this can be done?


Thanks,
Drammy
 

taqvia

Member
It can be performed through a script.

Write a small script that will fire the tabanalys and output it to a .txt file.
Once the process is complete just send it through mail
cat tab.txt | mailx -s "TAB Report" <receiver mail id >

or send the file as attachment

Arshad
 

TomBascom

Curmudgeon
If you're running UNIX "cat" is a very basic command. You usually learn about it in day 1 of your UNIX command line class. "man cat" will tell you all about it ;)

If you're not running UNIX you're missing the idea that you should tell us what OS and what version of Progress you're running so that we can provide more useful responses. Windows doesn't have nice simple commands like "mailx" either.
 

Drammy

Member
Thanks Tom,

This isn't for any particular OS. I would just like to know how to do it. My Clients use both Unix and Windows.

Although, now I know how to do it on Unix.
 

comatt1

Member
It can be performed through a script.

Write a small script that will fire the tabanalys and output it to a .txt file.
Once the process is complete just send it through mail
cat tab.txt | mailx -s "TAB Report" <receiver mail id >

or send the file as attachment

Arshad

mailx -s "TAB Report" <email or sendmail alias> < tab.txt
ex. mailx -s "TAB Report" dba@company.com < tab.txt
ex w/alias. mailx -s "TAB Report" dba < tab.txt

Also works.

I am not a huge fan of using cat within my mailx commands. May be a personal preference. However, it could save a byte or 2 :)

If you use aliases, which I love to use, I hate hardcoding scripts with email addresses

  • edit the /etc/mail/aliases file (may need to be root if your directory permissions are correct).
  • add a line with something like - dba:dba@company.com
  • save the file
  • run /usr/sbin/newaliases
If you intend to do this within a script and run it in the future, I have found this a helpful practice.

If the person receiving the scripts is let go, you just need to change how the alias is referenced - dba:newdba@company.com - and follow the same steps to instantiate the alias.

My two cents.
 
Top