Sponsored Content
Top Forums Shell Programming and Scripting Send email if latest file in a directory is older than 2 hours Post 302997543 by RudiC on Tuesday 16th of May 2017 08:16:56 AM
Old 05-16-2017
For just the time check, try
Code:
[ "$(find . -cmin -120)" ] || echo mail -s "subject one" recipient@url.com

For the youngest file's time stamp, your attempt should work.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

unix command/s to find files older than 2 hours in a directory

I need to write a script to find files older than 2 hours in set of direcotries and list them ina mail. I know find command ti list files greater/lesser than days but i need to do it for hours. Any input. (6 Replies)
Discussion started by: Presanna
6 Replies

2. AIX

how to find files older than 2 hours

I need help to find files in a directory that are older than 2 hours. Any help would be great. (3 Replies)
Discussion started by: pt14
3 Replies

3. Shell Programming and Scripting

shell script to send email with usage of space in the directory as description :

shell script to send email with usage of space in the directory as description : Please any one help me in writing a script to send email with usage of space in the directory as description . (3 Replies)
Discussion started by: sakthifire
3 Replies

4. Shell Programming and Scripting

Move the latest or older File from one directory to another Directory

I Need help for one requirement, I want to move the latest/Older file in the folder to another file. File have the datetimestamp in postfix. Example: Source Directory : \a destination Directory : \a\b File1 : xy_MMDDYYYYHHMM.txt (xy_032120101456.txt) File2: xy_MMDDYYYYHHMM.txt... (1 Reply)
Discussion started by: pp_ayyanar
1 Replies

5. Shell Programming and Scripting

Shell script: If a file stays in a particular directory more than 30 min send an email

Hi , I am new to shell scripting. i have a requirement say i will receive a file in a directory say /xyz.if that file stays in that directory more than 30 min i need to get a mail to my outlook.this should run for every 20 min in crontab. can anyone help me? (8 Replies)
Discussion started by: muraliinfy04
8 Replies

6. Shell Programming and Scripting

Script to send email after comparing the folder permissions to a certain permission & send email

Hello , I am trying to write a unix shell script to compare folder permission to say drwxr-x-wx and then send an email to my id in case the folders don't have the drwxr-x-wx permissions set for them . I have been trying to come up with a script for few days now , pls help me:( (2 Replies)
Discussion started by: nairshar
2 Replies

7. Shell Programming and Scripting

files older than few hours

Hi All I need to know the command which can be used to list the files which are 3 hours old so that it can be deleted. (3 Replies)
Discussion started by: mskalyani9
3 Replies

8. Shell Programming and Scripting

Loop multiple directory, find a file and send email

Hello ALL, need a BASH script who find file and send email with attachment. I have 50 folders without sub directories in each generated files of different sizes but with a similar name Rp01.txt Rp02.txt Rp03.txt ...etc. Each directors bound by mail group, I need a script that goes as... (1 Reply)
Discussion started by: penchev
1 Replies

9. Shell Programming and Scripting

To get older than last 7days records using awk scripting to generate report and send email

Hello All, I have need as below: 1--> I need to get all users(who submit jobs) and their details by using below command: qstat -u \* output of the above command looks line below: job-ID prior name user-id state "submit/start at" queue jclass slots ja-task-ID... (5 Replies)
Discussion started by: VasuKukkapalli
5 Replies

10. Shell Programming and Scripting

Send an email if "No such file or directory" in the shell script program log in EBS concur

Hi All, I have the below code(.sh) and need to send an email. #!/bin/bash cp /u02/xxc_incoming/TEST*.dat /u02/xxc_archive_incoming/AMER7764_ARPP_2/ cat /u02/xxc_incoming/TEST*.dat > /u02/xxc_incoming/XXC_TEST.dat rm /u02/xxc_incoming/TEST*.dat cd $XXC_TOP/bin sqlldr userid=apps/<pwd> ... (12 Replies)
Discussion started by: Mist123
12 Replies
formmailtest(1) 					      General Commands Manual						   formmailtest(1)

NAME
formmailtest - attempt to use formmail to relay to a DSBL-complaint host SYNOPSIS
formmailtest <url> [<spoof recipient>] DESCRIPTION
formmailtest attempts to connect to the specified host and uses several different to attempt to relay through the FormMail script located at <url>. It can do more tests if the normal recipient for that FormMail script is provided as <spoof recipient>, but it can quite often relay without. Tests are done with both GET and POST to attempt to bypass any firewall/httpd.conf/.htaccess pseudo-security. In the tests described below, DOMAIN is the section of <spoof recipient> after the @ sign, USER is the section before, and DASHDOMAIN is DOMAIN after all periods have been replaced by dashes. Tests: recipient=listme@dsbl.org recipient=dsbl.org!listme realname=&email= Cc: listme@dsbl.org&recipient=() realname=) Cc: listme@dsbl.org (&recipient=() recipient=listme%dsbl.org@DOMAIN recipient=dsbl.org!listme@DOMAIN recipient=listme@dsbl.org(DOMAIN recipient=<listme@dsbl.org>DOMAIN realname=&email=0c: listme@dsbl.org&recipient=DOMAIN realname=)0c: listme@dsbl.org (&email=&recipient=DOMAIN recipient=listme@dsbl.org(USER@DASHDOMAIN recipient=<listme@dsbl.org>USER@DASHDOMAIN AUTHOR
Ian Gulliver <ian@penguinhosting.net> SEE ALSO
dsbl.conf(5), spamtrap(1) 2002-04-03 formmailtest(1)
All times are GMT -4. The time now is 08:07 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy