To create alist of files created in the last 1 hour.


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers To create alist of files created in the last 1 hour.
# 1  
Old 02-12-2008
To create alist of files created in the last 1 hour.

Hi,

I need to create a script whcih ill run ever hour and will check all the files which are created in that hour for an error string.
Need help in finding all the files which were created in the last 1 hour.

Thanks in Advance.
Asheesh
# 2  
Old 02-12-2008
Can you do a "find / |grep [I]Timestamp[I] ? Or use the find for what ever directory you need?
# 3  
Old 02-12-2008
Tools not sure if available in all environments, but

try

find * -mmin -60 (modified time), or
find * -cmin -60 (created time)
# 4  
Old 02-12-2008
Quote:
Originally Posted by joeyg
try

find * -mmin -60 (modified time), or
find * -cmin -60 (created time)
agree with joeyg, AFAIK you need gnu find, for example AIX find does not have the options mmin/cmin, I think most linuxes do use the gnu find.
# 5  
Old 02-14-2008
Bug

Hi Asheesh,
Try this ...
-----------------------------------
#!/bin/sh

#Get current time_stamp
ts=`date +%m%d%H%M`;export ts
ts=`expr $ts - 100`

#Create file with time_stamp
touch -t 0$ts check_flag

#Check for newer files than flag
find . -newer check_flag

#Remove time_stamp
rm check_flag

exit 0
--------------------------------------------
This User Gave Thanks to happy.tripathy For This Post:
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Find if create time of last created file in a directory is older than 5 minutes

A process xyz is running and creating file1, file2, file3, .... filen. how do i know if the process has stopped and createtime of the last file (filen) is older than 5 minutes? OS is AIX (3 Replies)
Discussion started by: malaika
3 Replies

2. Shell Programming and Scripting

List files with date, create directory, move to the created directory

Hi all, i have a folder, with tons of files containing as following, on /my/folder/jobs/ some_name_2016-01-17-22-38-58_some name_0_0.zip.done some_name_2016-01-17-22-40-30_some name_0_0.zip.done some_name_2016-01-17-22-48-50_some name_0_0.zip.done and these can be lots of similar files,... (6 Replies)
Discussion started by: charli1
6 Replies

3. Shell Programming and Scripting

How to compare two file contents which created within one hour?

Hi Gurus, I need to compare two file contents and log the difference. the detail as below: in current directory there is file abc20140728_1020.txt abc20140728_1110.txt I need to find the files which created within 60 minutes first then compare the contents. I am able to use find... (12 Replies)
Discussion started by: ken6503
12 Replies

4. Shell Programming and Scripting

How to find the files created within one hour in Solaris?

Hi Gurus, I want to find the file created within one hour in solaris. I have tried below command, but it is no lucky. $find . -mtime -1/24, -name "abc*" above command give me the file name which created two hours ago find . -cmin -60, -name "abc*" above command I got error as... (4 Replies)
Discussion started by: ken6503
4 Replies

5. Shell Programming and Scripting

How to pick only the files which are generated in one hour?

Hello Masters, I need one help. I want to copy the files which are continuously generating on one server. But this would be on hourly basis. e.g. -rw-rw-r-- 1 akore akore 0 Feb 12 03:20 test1.log -rw-rw-r-- 1 akore akore 0 Feb 12 03:42 test2.log -rw-rw-r-- 1 akore akore 0 Feb 12 04:22... (2 Replies)
Discussion started by: akore83
2 Replies

6. Shell Programming and Scripting

How to convert 24 hour time to 12 hour timing?

Hi friends, I want to convert 24 hour timing to 12 hour please help me... my data file looks like this.. 13-Nov-2011 13:27:36 15.32044 72.68502 13-Nov-2011 12:08:31 15.31291 72.69807 16-Nov-2011 01:16:54 15.30844 72.74028 15-Nov-2011 20:09:25 15.35096 ... (13 Replies)
Discussion started by: nex_asp
13 Replies

7. Shell Programming and Scripting

match sentence and word adn fetch similar words in alist

Hi all, I have ot match sentence list and word list anf fetch similar words in a separate file second file with 2 columns So I want the output shuld be 2 columns like this (3 Replies)
Discussion started by: manigrover
3 Replies

8. Shell Programming and Scripting

Table with no of files every hour

Hello, In a HP-UX system we receive several files evry hour. The file is in the format filename+hour e.g: sv00 sv01 sv02 sv03 sv04 sv05 sv06 sv07 sv08 sv09 sv10 sv11 sv12 sv13 sv14 sv15 (2 Replies)
Discussion started by: drbiloukos
2 Replies

9. Shell Programming and Scripting

Count files every hour

Hi, I have a directory which uploads files every minute.I want to check the number of files uploaded for every one hour. I want to run a cron every hour to chk this but iam hanged like how to write the script. Like the script should count for one hr ie from 00:00 to 01:00 hrs then next hr... (3 Replies)
Discussion started by: nessj
3 Replies

10. Shell Programming and Scripting

Need to process files created an hour ago

Hello all, I would like to ask for an advice on how to deal with the following scenario. Every now and then, our ERP system creates an interface text file with the following file format - XORD????.DLD where ???? is a sequence number. We can have 1 or more XORD files created in an hour. ... (9 Replies)
Discussion started by: negixx
9 Replies
Login or Register to Ask a Question