Find files based on time


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Find files based on time
# 1  
Old 10-01-2004
Find files based on time

Hi,

Whats the command for finding files older then 20mins. This has to be part of the find command as it will be part of a cleanup script.

thanks
Budrito
# 2  
Old 10-01-2004
hai

find . -mmin 20 -print command prints the files which are exactly 20 miniutes older

find . -mmin +20 -print command prints the files which are more than 20 miniutes older

Sorry no idea about cleanup script.... Let me try to get you more informations
# 3  
Old 10-05-2004
find . -mmin +20 -print -exec rm -f {} \;
# 4  
Old 10-08-2004
Sorry guys but this is TRU64 and it doesn't have a -mmin option thats why its a difficult issue.

cheers
# 5  
Old 10-08-2004
You will need to use a reference file. See this thread for examples.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Segregate files based on the time they are created

Hi All, I have scenario where I need to zip huge number of DB audit log files newer than 90 days and delete anything older than that. If the files are too huge in number,zipping will take long time and causing CPU spikes. To avoid this I wanted to segregate files based on how old they are and... (2 Replies)
Discussion started by: veeresh_15
2 Replies

2. Shell Programming and Scripting

Find time difference based on logfile

Hi All, Firstly thank you for the forum members I need to find time difference b'w two rows of timestamp using awk/shell. Here is the logfile: cat business_file start:skdjh:22:06:2010:10:30:22 sdfnskjoeirg wregn'wergnoeirnfqoeitgherg end:siifneworigo:22:06:2010:10:45:34... (3 Replies)
Discussion started by: Srinivas Gadi
3 Replies

3. Shell Programming and Scripting

Extracting log files based on date and time.

Hi All, i have some log files generated in a folder daily with the format abc.def.20130306.100001 ghi.jkl.20130306.100203 abc.def.20130305.100001 ghi.jkl.20130305.100203 the format is the date followed by time . all i want is to get the files that are generated for todays... (3 Replies)
Discussion started by: mahesh300182
3 Replies

4. Shell Programming and Scripting

List Files Based On Time & Date

Hi All, I am using HP Unix. I want to list files which are created 5 minutes before on the same day as well as before today's date. I checked all the forums and the commands provided there does not work on HP Unix. Can you please help me on this? Your help is highly aprreciated. Thanks and... (3 Replies)
Discussion started by: angshuman
3 Replies

5. Shell Programming and Scripting

How to list the files based on the modification time using the find command?

Hi All, I need to list the files based modification time of the files from a directory, I cannot use "ls -t" as there are lot of files, which "ls" command cannot handle. New files will land there daily. So iam looking for an alternative through "find"command. All suggestions are welcomed. ... (6 Replies)
Discussion started by: Kesavan
6 Replies

6. Shell Programming and Scripting

Shell script to find the run time based on log entries?

Shell script to find the run time based on log entries? Below is the log files content updated when the script test.sh runs. I would like to calculte the difference between first update time stamp and last update time stamp to find the run time of the script. The below log file shows the first... (1 Reply)
Discussion started by: mailtopranesh
1 Replies

7. Shell Programming and Scripting

Moving the files based on count and time.

Hi, I have a requirement ,let us say 1000 files needs to be transferred in an hour from one path to another path and if the files (1000 files) are transferred within an hour ( say 40 mins), then the process should remain idle for the remaining time ( 20 mins). (3 Replies)
Discussion started by: Asaikarthik
3 Replies

8. UNIX for Advanced & Expert Users

Find and store files based on FileName and Modified Time

Hi, I am currently using the following command: files=(ls enuCPU??.????.exp ntuCPU??.????.exp) I need to now change the commmand to store the file names of files that have been modified before datetime equal to say '02/16/2008 20:30:00' What could I use? (2 Replies)
Discussion started by: edisonantus
2 Replies

9. UNIX for Dummies Questions & Answers

How to search for files based on the time stamp

Hi All, I know the timestamp of a file. Now i would like to list all the files in the with the same time stamp in the same file. Any help would be appreciated. Thanks. sunny (1 Reply)
Discussion started by: sunny_03
1 Replies

10. Shell Programming and Scripting

Error when find and remove directory based on time

Hi Experts, Below command remove directory exactly but trying again to find the same directory and giving following error. I would appreciate for your help friends. find ./2* -type d -mtime +0 -exec rm -rf {} \; find: 0652-081 cannot change directory to </home/busi/backup/200606>: : A... (1 Reply)
Discussion started by: HAA
1 Replies
Login or Register to Ask a Question