The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Sed Help in Updating something only in one particular file. bisla.yogender Shell Programming and Scripting 4 03-24-2008 11:48 AM
Updating file in loop braindrain Shell Programming and Scripting 4 06-20-2007 01:37 PM
Why my sar is not updating the output file. skneeli UNIX for Advanced & Expert Users 1 11-12-2006 08:29 PM
Updating a File in a Zip Archive dbridle AIX 6 09-27-2006 03:29 PM
sending and updating a file over network bhakti High Level Programming 1 09-21-2005 02:10 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 11-01-2007
raj333 raj333 is offline
Registered User
  
 

Join Date: Nov 2007
Posts: 2
Question TO know whether file is updating or not

Hi All,

I am new to scripting.

my requirement is ,

I want to know whether the file(i.e., log file) is updating or not.
It should search for every 15 min. If it is not updating means it needs to send out a automatic mail.

can you please help me in this.
  #2 (permalink)  
Old 11-01-2007
porter porter is offline Forum Advisor  
Registered User
  
 

Join Date: Jan 2007
Posts: 2,965
Something like

Code:
#!/bin/sh
while true
do
      if test thefile -ot magic
      then
            echo "stale" | mailx -s warning foo@bar
      fi
      touch magic
      sleep 900
done
  #3 (permalink)  
Old 11-05-2007
raj333 raj333 is offline
Registered User
  
 

Join Date: Nov 2007
Posts: 2
Its working now.

Thanks , Its working.
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 11:12 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0