How to send mail using find command?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How to send mail using find command?
# 1  
Old 07-10-2015
How to send mail using find command?

Hello,
I wanted to send mail to multiple receiptant by using uuencode with find command.
I have used the below find command to search a file, which generating daily at the particular time. [Between 06.40 to 06.50 AM].

Code:
find . -type f -mtime -1 -printf '%f %TH:%TM\n' | awk '$NF>"06:40" && $NF<"06:50" {print $1}'

I wanted to send mail within find command.

Please suggest

Thanks-
Pokhraj
# 2  
Old 07-10-2015
Code:
find . -type f -mtime -1 -printf '%f %TH:%TM\n' | awk '$NF>"06:40" && $NF<"06:50" {print $1}' | mailx -s <subject> user1@host,user2@host2

# 3  
Old 07-10-2015
Thanks for the update.
I wanted to attach those files in email, which can be get at find command.

Thanks-
Pokhraj
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Unable to send mail with 'mail' command

I am unable to cause the 'mail' command to send mail from my linux ubuntu 15.10 computer. File 'mail.log' typically reports Connection timed out. I issue the command: mail -s "my subject" recipient@domain.com < filenamewhere filename is a file containing my message. Specifically, the... (3 Replies)
Discussion started by: tcnm
3 Replies

2. Shell Programming and Scripting

Mail command --> send multiple attachments

Hi, i try to send two (multiple) files by the mail-console-command mail -s TEST -a f1.pdf f2.pdf n.ame@ms123.de but it doesn't work. can someone give me a hint? Thanks in advance, IMPe (2 Replies)
Discussion started by: IMPe
2 Replies

3. AIX

Mail command to send attachements

I tried the below command uuencode data.txt | mailx -s “Test Mail” “mrp@xyz.com” But I get the below error ksh: uuencode: not found. Null Message body; hope that' ok which clearly tell that uuencode utility is not found. Is there any other way to send attachments with mail through... (7 Replies)
Discussion started by: rpm120
7 Replies

4. Shell Programming and Scripting

Not able to send the mail using mail and mailx command

Hi All, I am trying to send a mail from linux server but could'nt able to send the mail. I tried the below syntax's so far but no luck. mail -s “Hello world” abc@xyz.com < /usr/g/txt.log cat "txt.log" | mailx -s "Hello world" abc@xyz.com mailx -s “Hello world” abc@xyz.com <... (2 Replies)
Discussion started by: scriptscript
2 Replies

5. Fedora

Need to send mail using mail command

Hi Guys, Am tried with the mail & mailx command to send mail to other localhost machine, Which are all connected in a LAN. I can not able to send, Either it wont display any error message at that time and later am receiving a failure mail.. But i can send and receive (from-to) in my machine..... (28 Replies)
Discussion started by: Adhi
28 Replies

6. Shell Programming and Scripting

Error in send mail command

Hi, I am getting the following error while running send mail command from a shell script? Insufficient disk space; try again later How to handle this error? (1 Reply)
Discussion started by: AhmedLakadkutta
1 Replies

7. Shell Programming and Scripting

Send mail from command line

Hi All; I need to send emails from command line in some of my shell scripts. I tried : mail -s "Subject" member@body.com < testfile where test file contains body of the mail This work on my mac computer at work BUT not on my mac laptop. Does anyone have any ideas why? Thanks Walforum (1 Reply)
Discussion started by: walforum
1 Replies

8. Shell Programming and Scripting

script to find a file and send a mail

I need a shell script which checks for a file in a particuler folder and should send me a mail if the file of that name is present. Please help me on this.I am new to shell scripting. (6 Replies)
Discussion started by: jayaramanit
6 Replies

9. Shell Programming and Scripting

find files older than 30mins,count and send mail

Hi all, I wrote this script to find files older than time parameter, count the number of files, and send an email to me that some files are in a particular folder. For the particular path, the script should wait delay parameter before running again. For example, assuming the input file looks... (4 Replies)
Discussion started by: kayarsenal
4 Replies

10. UNIX for Dummies Questions & Answers

command line send mail

Hi, I am trying to send mail in ubuntu. I have installed postfix. In Redhat I could just type: mail name@domain.com I get the error that the command mail is not found. Does anyone know if there is a different command line to send mail? Can I install the command? Thanks, Eric (1 Reply)
Discussion started by: ejbrever
1 Replies
Login or Register to Ask a Question