delete files by date wise


 
Thread Tools Search this Thread
Operating Systems Solaris delete files by date wise
# 1  
Old 07-16-2009
MySQL delete files by date wise

Hi guys,

I want to delete files from june 13 to june 30, using rm command can any one tell me the sintax to remove. I ahve hunderd of core files in my /var dir. so i want to clear last month core files. Thanks in Advance.Smilie)
# 2  
Old 07-16-2009
There are a couple of ways to do this. Do the names of the core files include the date they were created?
# 3  
Old 07-16-2009
You can do something like this

Code:
find . -name core* -mtime +15 -exec rm -f {} \;

This finds all core files in the current directory (.) which are older 15 days and deletes them.

Prior the rm -f you can check which files will be deleted with a echo

Code:
find . -name core* -mtime +15 -exec echo {} \;


Last edited by gnom; 07-16-2009 at 08:28 PM..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Date wise calculations?

POST_DATE CHECK_NUMBER TYPE LOGIN_NAME 2015.09.09 XXXXXXXXXX mark XXXXXXXXXX 2015.09.09 XXXXXXXXXX fsadf XXXXXXXXXX 2015.10.05 XXXXXXXXXX defaa XXXXXXXXXX 2015.10.05 XXXXXXXXXX dewe XXXXXXXXXX 2015.10.06 XXXXXXXXXX dqwe XXXXXXXXXX 2015.09.14 XXXXXXXXXX dt4e XXXXXXXXXX... (22 Replies)
Discussion started by: nikhil jain
22 Replies

2. Shell Programming and Scripting

Insert values into a file 0 as per the date wise

Hi The file contains 12 months of date and less than 12 months of data I want to display if date filed less than 12 months of data I want to insert a value amount 1 to amount4 0 and dates as well. 12345|Date|cntry|amount1|amount2|amount3|amoun4... (2 Replies)
Discussion started by: jagu
2 Replies

3. Shell Programming and Scripting

Extract count of string in all files and display on date wise

Hi All, hope you all are doing well! I kindly ask you for shell scripting help, here is the description: I have huge number of files shown below on date wise, which contains different strings(numbers you can say) including 505001 and 602001. ... (14 Replies)
Discussion started by: VasuKukkapalli
14 Replies

4. Shell Programming and Scripting

Generate sum of a particular column date wise

Hi All, I have a file with below content 01/22/2014,23:43:00,1742.8, 01/22/2014,23:43:00,1742.8, 01/22/2014,23:44:00,1749.06666666667, 01/25/2014,23:45:00,2046.45, 01/25/2014,23:43:00,1742.8, 01/25/2014,23:44:00,1749.06666666667, 01/25/2014,23:45:00,2046.45, 01/25/2014,23:43:00,1742.8,... (4 Replies)
Discussion started by: villain41
4 Replies

5. Shell Programming and Scripting

How to read files by Server Creation date wise?

Hi All, I would have many files in the server with xyz*.dat -- Static file name Physical files: xyz1.dat - 01PM xyz2.dat - 02PM xyz3.dat - 03PM In present version we are using for f in $file_name do fname=`ls $f | grep -v ^'\|'$ | sed s/' '/'\\ '/g` .... sqlldr... (4 Replies)
Discussion started by: Dharv
4 Replies

6. Shell Programming and Scripting

Delete log files content older than 30 days and append the lastest date log file date

To delete log files content older than 30 days and append the lastest date log file date in the respective logs I want to write a shell script that deletes all log files content older than 30 days and append the lastest log file date in the respective logs This is my script cd... (2 Replies)
Discussion started by: sreekumarhari
2 Replies

7. Shell Programming and Scripting

Search a file column wise and delete it

Scottn, m really sorry but i have not got my answer yet. my concern is how to delete the row !!! i have a file which has a column that is unique i am intending to serach it and if it is there to remove the row. the file looks like ROLLNO,NAME ,SUB1,SUB2,SUB3,TOTAL,PERCENTAGE,RESULT... (9 Replies)
Discussion started by: gotam
9 Replies

8. Shell Programming and Scripting

Search a file column wise and delete it

i have a file which has a column that is unique i am intending to serach it and if it is there to remove the row. the file looks like ROLLNO,NAME ,SUB1,SUB2,SUB3,TOTAL,PERCENTAGE,RESULT 15 ,rig ,34 ,56 ,87 ,177 ,59 % ,PASS 23 ,wel ,45 ,76 ,56 ,177 ,59 % ... (0 Replies)
Discussion started by: gotam
0 Replies

9. Shell Programming and Scripting

Need to zip the files date wise --urgent Help needed

Hi all, this is my first post, i need to write a script to zip the files with datewise below are the log files. -rw------- 1 root sso 85316156 May 24 22:11 core_test_smservaz_104_104_1243217459_8896 -rw------- 1 root sso 90413304 May 25 22:12 core_test_smservaz_104_104_1243303895_20912... (4 Replies)
Discussion started by: lcschandu
4 Replies

10. Shell Programming and Scripting

Not able to delete the files in day wise...

Dear All, I am not able to remove the files in my AIX 5.3 server. My files List /iims-home/data/uat1/batch/staging -rw-r--r-- 1 iims iims 5743 Jun 12 09:04 ErrorReport2008-05-20 09-04-18.doc -rw-r--r-- 1 iims iims 191213683 Jun 12 09:05... (1 Reply)
Discussion started by: bvijaycom
1 Replies
Login or Register to Ask a Question