Remove files which created date before 10 days on HP-UX


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Remove files which created date before 10 days on HP-UX
# 1  
Old 12-21-2008
Remove files which created date before 10 days on HP-UX

Hi All,

Could you please let me know if there is any one can help to create a shell script to remove some files which is the created date for them greate than 10 days (sysdate-10)

Please try to email me on email removed

Thanks in advance,

Murad

Last edited by jim mcnamara; 12-21-2008 at 06:03 AM.. Reason: removed email address
# 2  
Old 12-21-2008
Code:
find /path/to/files -name '*' -type f -mtime +10 -exec rm -f {} \;

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Find the count of files by last created date based on the given date range

My unix version is IBM AIX Version 6.1 I tried google my requirement and found the below answer, find . -newermt “2012-06-15 08:13" ! -newermt “2012-06-15 18:20" But newer command is not working in AIX version 6.1 unix I have given my requirement below: Input: atr files: ... (1 Reply)
Discussion started by: yuvaa27
1 Replies

2. Shell Programming and Scripting

Find the sum of files created 5 days before

Hi, I want to find the sum of all the files created 5 days ago and store it in a variable. (os is HP-UX) can this be extracted from ls -l Is there any other way of getting the sum of all the files created (4 Replies)
Discussion started by: bang_dba
4 Replies

3. Shell Programming and Scripting

Script to remove folders by date created

Hi All I require to generate a script that deletes folders and sub directoires from a set period after creation. So have folder X on a daily basis i have job folders being created folder name 1234568. What i need to do is keep this folder pruned. So say 7 days after creation of the job folder its... (4 Replies)
Discussion started by: treds
4 Replies

4. Shell Programming and Scripting

Showing files that were created at a certain Date

Guys i am having a bit of a trouble finding the creation date of a file. What i have to do is to redirect the output of a command (which i believed was ls -l but this command shows only the Modification time) into a file, which will contain all the files that were created on a certain date, for... (2 Replies)
Discussion started by: jimas13
2 Replies

5. Shell Programming and Scripting

print out date of files last created??

Hello everyone, I have this script here: use Time::Local; opendir (D, $ARGV) or die "Cant open"; foreach $file (readdir D) { $path = "$ARGV/$file"; next if ! -T $path; $last_mod = (stat $path); ($sec,$min,$hour,$mday,$mon,$year,$wday) = localtime ($last_mod); printf "%-15s:... (4 Replies)
Discussion started by: new bie
4 Replies

6. UNIX for Dummies Questions & Answers

How to find files created some days before?

HI, I have 2 questions. 1> Is there any code to see files that created some day or some time before in a directory??? 2> how or where i will find the last exit status of a process?? thanks (6 Replies)
Discussion started by: jyotidas
6 Replies

7. Shell Programming and Scripting

How can i remove the files generated on 10 days before!!!

Dear Friends! i am wirking on the IBM AIX version 5.3. and i wrote a script to delete the files whicha re generated on 10 days before to the present day. but iam not able to delete the files with the below script so please check and correct me. dt=`TZ=aaa480 date +%d`... (2 Replies)
Discussion started by: innamuri.ravi
2 Replies

8. UNIX for Dummies Questions & Answers

Display files created on particular date

hi , i am trying to display the files created on a particular date. I have tried using find .-mtime +n but these files are created on november 6th 2007 , so i'm not sure of what the 'n' value should be. And the number of files created on that particular day are more than 5000 so i have to make a... (6 Replies)
Discussion started by: amit_kv1983
6 Replies

9. Shell Programming and Scripting

List files created before Noon 2 days prior

Our nightly updates run in the evening and finish around 8am. My boss wants the current log files kept on the server for 2 days, but wants anything created before noon, 2 days prior archived. I was thinking of using touch to set a temporary file with a date of today-2 and a time of noon, then... (3 Replies)
Discussion started by: prismtx
3 Replies

10. UNIX for Dummies Questions & Answers

Deleting files created before two days ago

Dear All: I want to build a shell that delete files created two or more days ago ... I think it could be built using a special command with ls or grep, I'd apreciate any help from you guys I have a lot of log files from november, december, january and this tool will help me a lot The files... (3 Replies)
Discussion started by: josecollantes
3 Replies
Login or Register to Ask a Question