- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Script to send mail every monday.
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
12-28-2003 08:26 PM
12-28-2003 08:26 PM
can anybody help me.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-28-2003 08:33 PM
12-28-2003 08:33 PM
Re: Script to send mail every monday.
and schedule it in crontab to run every monday.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-28-2003 08:35 PM
12-28-2003 08:35 PM
Re: Script to send mail every monday.
An entry like
0 11 * * 1 myscript
will send the mail out an 11.00 every monday.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-28-2003 08:48 PM
12-28-2003 08:48 PM
Re: Script to send mail every monday.
please do help me...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-28-2003 08:59 PM
12-28-2003 08:59 PM
Re: Script to send mail every monday.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-29-2003 01:56 AM
12-29-2003 01:56 AM
Re: Script to send mail every monday.
It reads the date using the date command and then it checks the keys in a data file.
If any of the keys match either the day of the week or the month/day combination then part of the matching line is put into the subject field and the whole file is emailed.
I use this as a way of doing todo lists for myself. I run it out of cron each day.
Here is my script. After that I will list the awk script that is called. I'm sure it could be cleaned up, but it certainly works.
~/notes is the directory where I keep my todo lists.
#!/bin/sh
cd ~/notes
touch .ml0000
rm .ml*
date | awk '{print $1,$2$3}' | tr "[:lower:]" "[:upper:]" > .ml0000
cat .ml0000 > .ml0010
cat standard_notes >> .ml0010
awk -f ~/bin/ml.awk < .ml0010 > .ml0020
if [ -s .ml0020 ]
then
mailx -s " `cat .ml0020`" youremailaddresshere@yahoo.com < standard_notes
fi
Here's the awk script
BEGIN {printit="";}
NR==1 {keyone=$1; keytwo=$2;next}
keyone==$1 {printit=printit" / "substr($0,8,13);}
$1=="EVERY" {printit=printit" / "substr($0,8,13);}
$1=="WKED" {if(substr(keyone,1,1)=="S") printit=printit" / "substr($0,8,13);}
$1=="WKDY" {if(substr(keyone,1,1)!="S") printit=printit" / "substr($0,8,13);}
keytwo==$1 {printit=printit" / "substr($0,8,13);}
END {
if ( length(printit) > 2 )
print printit}
Sample line is:
THU Close calls
The script is looking at the first field to see if matches the right day of the week or date.
I will post a subset of this that just does mondays below.
Best regards,
Kent M. Ostby
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-29-2003 02:09 AM
12-29-2003 02:09 AM
Solutiontouch .mailit.uu1
rm .mailit.uu*
date | awk '/^Mon/' > .mailit.uu1
if [ -s .mailit.uu1 ]
then
mailx -s "Your message" kmo < messagefile
fi
exit
You would have to start up this script either via cron as mentioned earlier (and cron can do the mailing for you) ... or in a startup file on your system.