- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Script Heros
Categories
Company
Local Language
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
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
Community
Resources
Forums
Blogs
- 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
04-20-2004 12:47 AM
04-20-2004 12:47 AM
cut --------------->
for i in `cat /test/maillist | grep ADM | awk '{print $2}' `
do
mailx -s "`hostname` Make Recovery Status" $i < /tmp/make_tape_recovery.log
done
cut --------------->
I want to have emails going to diffent groups like ADM and USER. So, Ill I need to do is through it a permamiter on the group, subject and file that I want to send with the mail.
I know this is a lot, but I know you guys love this stuff.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2004 12:57 AM
04-20-2004 12:57 AM
Re: Script Heros
Kaps
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2004 01:02 AM
04-20-2004 01:02 AM
Re: Script Heros
what you got is:
a file full of mail
what you want is:
a mail, ok? But containg what?
Peace, R.
in the meanwhile, in 'for' cycle you can use
awk '/ADM/ {print $2}' /test/maillist
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2004 01:39 AM
04-20-2004 01:39 AM
Re: Script Heros
"get all of emails from one location"
As far as mailing groups goes why don't you just make aliases, instead of parsing files?
Then you can just email whatever group directly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2004 01:48 AM
04-20-2004 01:48 AM
Re: Script Heros
This is playing with fire since there are so many variables.
Why not change the scripts you have to mail themselves when a different default is needed
Cron will automatically send standard output and eventually standard error output to root or the owner of the crontab is you allow others to have cron.
See cron.allow
Output redirection to a specific mail address, disable/redirect the
standard output ,standard error and use a command in your script to send the
Crontab:
47 11 * * * /usr/local/bin/testit > /tmp/testit.out 2>&1
Output and error are redirected with the 2>&1 and disables the standard mail .
Cron Script:
# cat /usr/local/bin/testit
#!/usr/bin/ksh
echo "testit used at `date`"
mailx -s testit.mail name@machine < /tmp/testit.out
rm /tmp/testit.out
Thus user on machine received email which had the following :
"testit used at Tue Apr 20 15:51:25 METDST 2004"
Hope that will guide you
Steve Steel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2004 02:33 AM
04-20-2004 02:33 AM
Solution1. create a config file containing 2 columns
1st Name of the cronjob
2nd Email Adress (list)
i.e.
DEFAULT:user1@domain1
cronjob1:user1@domain1,user2@domain2
cronjob2:user3@domain3
2. modify all your cronjobs
2a.at the top of each job add
MY_NAME=$(basename $0)
exec > /tmp/$MY_NAME.$$.log
exec 2> &1
2b at the end of each job add
MAIL_ADDR=$(grep "^$MY_NAME:" /test/maillist | cut -d: -f2)
MAIL_ADDR=${MAIL_ADDR:-$(grep "^DEFAULT:" /test/maillist | cut -d: -f2)
cat /tmp/MY_NAME.$$.log | mailx -s "cronjob $MY_NAME on $(hostname)" $MAIL_ADDR
rm /tmp/MY_NAME.$$.log # if you like
hope this is what you wanted.....
regards
Juergen
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2004 02:35 AM
04-20-2004 02:35 AM
Re: Script Heros
MAIL_ADDR=${MAIL_ADDR:-$(grep "^DEFAULT:" /test/maillist | cut -d: -f2)}
this should be correct now...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2004 02:38 AM
04-20-2004 02:38 AM
Re: Script Heros
node a root -> .forward to wherever
node b -> mails node a root
etc..