Sponsored Content
Top Forums Shell Programming and Scripting Poll for a file. If not present...Send a alert mail Post 302417966 by phani333 on Saturday 1st of May 2010 09:59:32 PM
Old 05-01-2010
Poll for a file. If not present...Send a alert mail

Dear Experts,

I have a requirement where a 3rd party system places a file in my folder.I am running on HP UNIX. I would like to have a unix script which will check for the existence of the file. If yes OK. if the file is not placed then it has to send a mail to couple of emails ids saying that "File has not been placed."

Please guide me how to develop such a Unix script. I will schedule this script at 9:00AM everyday in the morning.

Thanks,
Phani Akella.

Last edited by phani333; 05-01-2010 at 11:39 PM.. Reason: specified my Unix flavour - HP UNIX.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Pull E-mail address from file, send e-mail

Hello, I am new to perl and need to create a script that will read a file and pull a name from the file and send e-mail. How can I use the following awk statement in a perl script? grep UNIXadmins /root/mail.conf | awk '{ print $2}' and use the output to send a e-mail. Any help would... (1 Reply)
Discussion started by: DC Heard
1 Replies

2. Shell Programming and Scripting

need to send alert mail

hi, i need to monitor a cron job that runs every 5 mins. if this cron job does not process the request for more than 6 hrs, an alert mail should be sent. how do i achieve this?? (1 Reply)
Discussion started by: smurala
1 Replies

3. Shell Programming and Scripting

How to use SSH to connect to Primary DB and send alert mail

Hi All, AIX 5.3 64 bit: I am using the below shell script the objective is: Objective: ======== Use SQL*Plus to query the MAX(SEQUENCE#) from both databases V$LOG_HISTORY view. If the STANDBY appears to be falling behind,then send alert mail through the below shell script: How... (0 Replies)
Discussion started by: a1_win
0 Replies

4. Shell Programming and Scripting

How to automatically send a mail alert if the script errors out

I have a script like this, which calls other scripts from that script: #!/usr/ksh moveFiles.sh extract.sh readfile=/home/sample.txt cat $readfile | while read line do file= `echo $line|awk '{print $4}'` if ; then mv $file /home/temp_stage fi (4 Replies)
Discussion started by: ss3944
4 Replies

5. Shell Programming and Scripting

Script to send an alert if a file is present in a directory for 10 min

hi, A script which look into a directory and send an alert via a mail. If there is any file exisiting in a directory for more then 10 min. (5 Replies)
Discussion started by: madfox
5 Replies

6. UNIX for Dummies Questions & Answers

How to send html file in a mail not as an attachment but it should display in the mail in table for

Hi The below script working when we are sending the html as attachment can u please guide how to send thesmae data in table form direct in the mail and not in mail attachment . cat Employee.sql SET VERIFY OFF SET PAGESIZE 200 SET MARKUP HTML ON SPOOL ON PREFORMAT OFF ENTMAP ON - HEAD... (0 Replies)
Discussion started by: mani_isha
0 Replies

7. Shell Programming and Scripting

how to write a shellscript to send a mail alert to the website user based on license expiration time

hi, i am very much new to shell scripting i have a requirement that i have to develop a License Renewal Alert system that has to give a alert mail to the users before 30days of user account expiration, by checking expiration date of the user with the data base, this system will... (0 Replies)
Discussion started by: deepu_Shscripts
0 Replies

8. UNIX for Dummies Questions & Answers

If File is present send a mail and Archive

Hi , Please help me with a logic, how can I acheive the below. I have a directory /eth/Src/, when ever there is a file(or files) created in this directory, (after the file is completely copied to the /eth/Src/ directory) I need to zip all the files and mail the files to a particular email id... (3 Replies)
Discussion started by: wangkc
3 Replies

9. Shell Programming and Scripting

Shell script to send mail alert

HI Guys, I am writing one shell script to send the mail alert to some email id's if the file not modified in last 10 mins but its not working, I believe MTIME is null string is wrong . can you please assist me on this. script :- filename="abc.txt" echo "Filename is $filename"... (1 Reply)
Discussion started by: abhigrkist
1 Replies

10. UNIX for Beginners Questions & Answers

Shell script to send mail alert

Hi I have below shell script to send mail alert , however I want to add more functionality in this script and that is , script should only check that file between 9 am to 5pm , and if there is no activity in this time 9 am to 5 pm for 2hours then it should give me mail alert, please help... (2 Replies)
Discussion started by: scazed
2 Replies
mh(1mh) 																   mh(1mh)

Name
       mh - introduction to MH

Description
       MH  is  the  name  of a powerful message handling system.  Rather than being a single comprehensive program, MH consists of a collection of
       fairly simple single-purpose programs to send, receive, save, and retrieve messages.  Refer  to	the  individual  MH  reference	pages  for
       descriptions of the programs that make up MH.

       Unlike  MH  is  not  a  closed system which must be explicitly run, and then exited when you wish to return to the shell.  Instead, you may
       freely intersperse MH commands with other shell commands.  This allows you to read and answer your mail while you have (for example) a com-
       pilation running, or are searching for a file or running programs to find an answer to someone's question before replying to them.

       To get started using MH, add the directory to your $PATH.  This is best done in one of the files or in your home directory.  Check the man-
       ual entry for the shell you use if you do not know how to do this.  Run the command.  If you have never used MH before, it creates the nec-
       essary  default files and directories after asking you if you wish it to do so.	The command moves mail from your system maildrop into your
       MH folder.  Each message is converted to MH format, and stored as separate files in your folder until you have read it.	When you have read
       a message, you can refile it in another folder that you have created.

       Folders are directories in which messages are stored: the folders themselves are stored in your Mail directory.	See and for more details.

       For  each  message it processes, prints a one-line display.  The one-line display contains the From: field, the Subject: field, and as much
       of the first line of the message as it can accommodate.	The first message that processes becomes your current message.	 All  MH  commands
       operate on the current message unless you have specified the msg argument.

       You need to run each time you wish to incorporate new mail into your folder.

       The command prints a list of the messages in your current folder.

       The commands and are used to read specific messages from the current folder.  Of these, displays the current message.  You can also display
       a specific message by specifying its number.  In the following example, the mail system displays the contents of message number 10  in  the
       current folder:
       % show 10

       The  commands and display the message numerically following and numerically preceding the current message, respectively.  In all cases, the
       message displayed becomes the current message.  If there is no current message, may be called with an argument, or may be used  to  advance
       to the first message.  The command (remove message) deletes the current message.

       You  can  delete  messages other than the current message by specifying the message number or numbers.  When you specify more than one mes-
       sage, you separate each message number by a space.  In the following example, messages 2, 4 and 6 in the current folder are deleted:
       % rmm 2 4 6

       The command is used to reply to a message.  It places you in the editor with a prototype response form.	While you are in the  editor,  you
       may view the item you are responding to by reading the file

       The command allows you to compose a message by putting you in the editor on a blank message header form, and then lets you send it.

       All  the  MH  commands may be run with the single argument -help, which causes them to print a list of the arguments with which they may be
       invoked.

       Commands which take a message number as an argument (for example) also take one of the following keywords:

       first	 The first message in the current folder.

       last	 The last message in the current folder.

       cur	 The current message in the current folder.

       prev	 The previous message in the current folder.

       next	 The next message in the current folder.

       Commands which take a range of message numbers, such as or also take any of the following abbreviations:

       num1-num2 Indicates all messages in the range num1 to num2, inclusive.  The specified range must contain at least one message.

       num:+n
       num:-n	 Up to n messages beginning with (or ending with) message num.	The value of num may be any of the MH message keywords: or

       first:n
       prev:n
       next:n
       last:n	 The first, previous, next or last n messages, if they exist.

       There are many other possibilities, such as creating multiple folders for different topics, and automatically refiling  messages  according
       to subject, source, destination, or content.  See the individual reference pages for more details of the rest of the MH commands.

       Following is a list of all the MH commands:

       alex(1mh)	 extract addresses from message headers
       ali(1mh) 	 list mail aliases
       anno(1mh)	 annotate messages
       burst(1mh)	 explode digests into messages
       comp(1mh)	 compose a message
       dist(1mh)	 redistribute a message to additional addresses
       folder(1mh)	 set/list current folder/message
       folders(1mh)	 list all folders
       forw(1mh)	 forward messages
       inc(1mh) 	 incorporate new mail
       mark(1mh)	 mark messages
       mhl(1mh) 	 produce formatted listings of MH messages
       mhmail(1mh)	 send or read mail
       mhpath(1mh)	 print full pathnames of MH messages and folders
       msgchk(1mh)	 check for messages
       msh(1mh) 	 MH shell
       next(1mh)	 show the next message
       packf(1mh)	 compress a folder into a single file
       pick(1mh)	 select messages by content
       prev(1mh)	 show the previous message
       prompter(1mh)	 prompting editor front end
       rcvstore(1mh)	 incorporate new mail asynchronously
       refile(1mh)	 file messages in other folders
       repl(1mh)	 reply to a message
       rmf(1mh) 	 remove folder
       rmm(1mh) 	 remove messages
       scan(1mh)	 produce a one line per message scan listing
       send(1mh)	 send a message
       slocal(1mh)	 receive mail hooks
       show(1mh)	 show (list) messages
       sortm(1mh)	 sort messages
       whatnow(1mh)	 prompting front-end for send
       whom(1mh)	 report who will receive a message when it is sent

       mh-alias(5mh)	 alias file for MH message system
       mh-format(5mh)	 format file for MH message system
       mh-mail(5mh)	 message format for MH message system
       mh_profile(5mh)	 user customization for MH message system
       mtstailor(5mh)	 system customization for MH

       ap(8mh)		 parse addresses RFC 822-style
       conflict(8mh)	 search for alias/password conflicts
       dp(8mh)		 parse dates RFC 822-style
       install-mh(8mh)	 initialize the MH environment
       post(8mh)	 deliver a message

Files
       Directory containing commands

       MH library

																	   mh(1mh)
All times are GMT -4. The time now is 09:31 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy