HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Email Trigger to Run a Shell Script
Operating System - HP-UX
1833187
Members
2439
Online
110051
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2005 06:20 AM
05-16-2005 06:20 AM
Email Trigger to Run a Shell Script
Anyone got a sample looper or cron runnable script handy that is triggered by an email to the UNIX account that runs the script?
I have a somewhat long running script that currently is run at 5AM in the morning but during the day may required to run in order to present more current data. I am thinking of having this event to be triggered by email.
I have a somewhat long running script that currently is run at 5AM in the morning but during the day may required to run in order to present more current data. I am thinking of having this event to be triggered by email.
Hakuna Matata.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2005 06:30 AM
05-16-2005 06:30 AM
Re: Email Trigger to Run a Shell Script
Still waiting on that email btw.
ls -1 /var/mail > /tmp/datafile
while read -f filename
do
num=$(cat $filename | grep trigger_phrase)
if [ $num -ge 1 ]
then
/usr/contrib/bin/shellscript
fi
num=0
done < /tmp/datafile
This will scan the contents of all the mail accounts. You can modify it to check the contents of one particular mailfile.
Don't forget to set a PATH before using this code in cron.
SEP
ls -1 /var/mail > /tmp/datafile
while read -f filename
do
num=$(cat $filename | grep trigger_phrase)
if [ $num -ge 1 ]
then
/usr/contrib/bin/shellscript
fi
num=0
done < /tmp/datafile
This will scan the contents of all the mail accounts. You can modify it to check the contents of one particular mailfile.
Don't forget to set a PATH before using this code in cron.
SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2005 06:38 AM
05-16-2005 06:38 AM
Re: Email Trigger to Run a Shell Script
SEP.
I have not forgotten ... it should come to you soon.
BTW, your suggestion is precisely what I have currently but I need something that actually invokes mail/mailx so I can search for a particular subject and even do validation/confirmation etc.
Nelson
I have not forgotten ... it should come to you soon.
BTW, your suggestion is precisely what I have currently but I need something that actually invokes mail/mailx so I can search for a particular subject and even do validation/confirmation etc.
Nelson
Hakuna Matata.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-17-2005 01:29 AM
05-17-2005 01:29 AM
Re: Email Trigger to Run a Shell Script
I would have the script get triggered by the users .forward file, as in:
\kevin, "|/home/kevin/bin/my_mail_exec"
The first entry keeps the mail in my inbox, the second passes all mail to the script. That script should establish the environment it needs to run, and parse the mail to see if it is the expected trigger.
man 5 aliases
\kevin, "|/home/kevin/bin/my_mail_exec"
The first entry keeps the mail in my inbox, the second passes all mail to the script. That script should establish the environment it needs to run, and parse the mail to see if it is the expected trigger.
man 5 aliases
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP