Operating System - HP-UX
1834388 Members
2447 Online
110066 Solutions
New Discussion

Email when a script is executed.

 
SOLVED
Go to solution
someone_4
Honored Contributor

Email when a script is executed.

 
3 REPLIES 3
Brian Markus
Valued Contributor
Solution

Re: Email when a script is executed.

Are you wanting to email when a specific script is executed, or any on the system? If it's a specific script, try doing a for loop through a ps -ef, grepping for the text you want, then use :
echo "script was executed" | mailx -s 'Someone has used your script' user@mail.domain.com

Hope this helps
Brian
When a sys-admin say's maybe, they don't mean 'yes'!
Mauro_3
Advisor

Re: Email when a script is executed.

It works when I put a user in destination of the email but I?m having trouble when trying to send to my Lotus Notes email. Supose my domain is testdomain and my user is user1 ,I have to do as follow ?
echo 'Test' | mailx -s 'Subject Test' user1@mail.testdomain.com

Cheers, Mauro

Re: Email when a script is executed.

If your Mail Domain name is testdomain.com and the username in that domain is rick then your email address of testdomain will be rick@testdomain.com
So,
echo "Mail testing" | mailx -s "Mail from UNIX" rick@testdomain.com
Win/Win