Compare file time


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Compare file time
# 1  
Old 11-01-2007
Compare file time

i need to write script where I need to keep monitoring a files timestamp, if it changes, I need to run another abc.sh script.

I am thinking I can save file's current timestamp in another file or enviornment variable and after 10 min compare the files timestamp with the original timestamp. If files timestamp is newer, run abc.sh

can someone please help.
# 2  
Old 11-01-2007
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Compare two time (HH:MM:SS) - ksh

Is it possible to compate two time (24-hour format)? What I need is to just check if the first time is earlier than the second time. ex: ./script.ksh 09:30:15 13:00:34 = okay ./script.ksh 05:25:00 02:30:50 = invalid arguments (1 Reply)
Discussion started by: erin00
1 Replies

2. Shell Programming and Scripting

How to compare the time in different format from a file?

15:09:50.350038 Reading A Data 15:09:50.371645 Reading B Data 15:10:55.655724 Initializing models 15:11:31.320920 Preparing Simulation 15:11:32.763217 Running Calculation 15:15:29.668882 Aggregating Results 15:15:29.950897 Persisting Results How could I make a matrix in H.M.S.MS... (7 Replies)
Discussion started by: manas_ranjan
7 Replies

3. Shell Programming and Scripting

Compare dates with time

Hi Team, I need to compare three dates and extract the greatest among them into a file. 21 Jan 2012 05:46:59,146 21 Jan 2012 02:12:30,113 17 Jan 2012 09:08:10,417 Please help regarding the same. Thanks in advance..!!! Please use tags where appropriate, thank you (6 Replies)
Discussion started by: jaituteja
6 Replies

4. Shell Programming and Scripting

time from 2 files to compare

In first file say first.txt, i have a content say 14:56. In second file, say second.txt i have content say 16:01.... I want to compare if these two times in these 2 files are having a difference of 15 minutes...Can any one please help? (2 Replies)
Discussion started by: manoj.b
2 Replies

5. Shell Programming and Scripting

Compare current time to timestamp on a file

I'm trying to compare 2 dates between current time and the timestamp on a file. The date format is mmdd Both return Apr 1 but when using if statement line 11: Apr 1: command not found error is returned #!/bin/sh log="DateLog" Current_Date=`date +%b%e` Filepmdate=`ls -l /file.txt |... (1 Reply)
Discussion started by: cillmor
1 Replies

6. Shell Programming and Scripting

Compare Last Modified Time across Time Zone

Hi, I'm new to shell script programming, I only have Java programming background. I'm writing a shell script to do file synchronization between 2 machines that located at different time zone area. Both machine were set its time zone according to its geographical location (Eg: server is at... (1 Reply)
Discussion started by: python
1 Replies

7. Shell Programming and Scripting

How to compare the mtime of a file with the current time?

Hi, I wondered if we could do this with shell script? How to compare the mtime of a file with the current time and check whether its less than 24 hours. Thanks.:b: (2 Replies)
Discussion started by: Krsh
2 Replies

8. Shell Programming and Scripting

Can we compare time ...

Hi ... Is there a possibility that timings from two files be compared?? If i have a set of files in a folder and i want to get the files only upto a particular time. eg: If i have the files staff 2388 Oct 3 04:33 x.ksh staff 3628 Oct 3 06:57 1.ksh staff 32383... (1 Reply)
Discussion started by: sparks
1 Replies

9. UNIX for Dummies Questions & Answers

Need to get 4 Hrs back time and compare with successive time

Hi all, I am working on a script in which i need to get 4 hrs back time from the current time which i got from this perl function : `perl -e 'print localtime(time() - 14400) . "\n"'` now i need to get this in a loop and increment that time by 15 minutes i.e i=900(=15minutes) `perl... (2 Replies)
Discussion started by: maanik85
2 Replies

10. UNIX for Dummies Questions & Answers

Compare Date And Time

Hi can somebody send me the code for compare two date and run a shell script. following is the code which i actully want but I am getting errors. regard Jamil . /opt/home/rep/.profile #!/bin/sh VALUE=`sqlplus -silent rep/Ndk38f7@dw <<END set pagesize 0 feedback off verify off... (5 Replies)
Discussion started by: Jamil Qadir
5 Replies
Login or Register to Ask a Question