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


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Not able to delete the files in day wise...
# 1  
Old 06-12-2008
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 ErrorReport2008-05-20 09-05-19.doc
-rw-r--r-- 1 iims iims 456571 Jun 12 09:06 ErrorReport2008-05-20 09-06-06.doc
-rw-r--r-- 1 iims iims 2675 Jun 12 09:07 ErrorReport2008-05-20 09-07-48.doc
-rw-r--r-- 1 iims iims 5743 Jun 12 09:09 ErrorReport2008-05-20 09-09-29.doc
-rw-r--r-- 1 iims iims 2675 Jun 12 09:12 ErrorReport2008-05-20 09-12-55.doc
-rw-r--r-- 1 iims iims 5743 Jun 12 09:14 ErrorReport2008-05-20 09-14-40.doc
-rw-r--r-- 1 iims iims 2675 Jun 12 09:18 ErrorReport2008-05-20 09-18-02.doc
-rw-r--r-- 1 iims iims 5743 Jun 12 09:19 ErrorReport2008-05-20 09-19-51.doc
-rw-r--r-- 1 iims iims 191670648 Jun 12 09:22 ErrorReport2008-05-20 09-21-34.doc
-rw-r--r-- 1 iims iims 909134 Jun 12 09:22 ErrorReport2008-05-20 09-22-21.doc
-rw-r--r-- 1 iims iims 2675 Jun 12 09:23 ErrorReport2008-05-20 09-23-09.doc
-rw-r--r-- 1 iims iims 5743 Jun 12 09:24 ErrorReport2008-05-20 09-25-03.doc
if i give the following command it is not working

find /iims-home/data/uat1/batch/staging/ -name "ErrorReport2008-*" -mtime +1 -exec /bin/rm {} \;

When i try to do ls command also failing?

bash-3.00# ls -ltr ErrorReport2008-05-20 05*
ls: 0653-341 The file ErrorReport2008-05-20 does not exist.
ls: 0653-341 The file 05* does not exist.

i think in file name there is a space (between bold letters).
ErrorReport2008-05-20 09-21-34.doc

Per day these files are creating around 30 GB. So if I want to delete one day older files (or) every hour files, how can I do that?

Please help me on this..

Thanks & Regards,
BVIJAY
# 2  
Old 06-12-2008
find /iims-home/data/uat1/batch/staging/ -name "ErrorReport2008-*" -mtime +1 | /usr/bin/xargs rm *

Try above command and check the usage of xargs(black horses) command on AIX. I have not much worked on AIX.

Shafi
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Delete all log files older than 10 day and whose first string of the first line is "MSH" or "<?xml"

Dear Ladies & Gents, I have a requirement to delete all the log files in /var/log/test directory that are older than 10 days and their first line begin with "MSH" or "<?xml" or "FHS". I've put together the following BASH script, but it's erroring out: for filename in $(find /var/log/test... (2 Replies)
Discussion started by: Hiroshi
2 Replies

2. Shell Programming and Scripting

Shell script for field wise record count for different Files .csv files

Hi, Very good wishes to all! Please help to provide the shell script for generating the record counts in filed wise from the .csv file My question: Source file: Field1 Field2 Field3 abc 12f sLm 1234 hjd 12d Hyd 34 Chn My target file should generate the .csv file with the... (14 Replies)
Discussion started by: Kirands
14 Replies

3. UNIX for Dummies Questions & Answers

Move the files between Current day & a previous day

Hi All, I have a requirement where I need to first capture the current day & move all the files from a particular directory based on a previous day. i.e move all the files from one directory to another based on current day & a previous day. Here is what I am trying, but it gives me errors.... (2 Replies)
Discussion started by: dsfreddie
2 Replies

4. Shell Programming and Scripting

How to delete subdirectories that are more than 1 day old AND have NO files on them

Hi Experts , At a particular dir , How to delete subirectories that are more than 1 day old AND have NO files in them. PS : -empty option is not working at my Sun OS version. Thanks, A (6 Replies)
Discussion started by: ajaypatil_am
6 Replies

5. Shell Programming and Scripting

How to delete files which more than one Day old?

I have a directory /opt/targets which generates more than 1000 files per day and I want to delete all the files which are more than 1 day old...ie 24hrs+ Please help.. (3 Replies)
Discussion started by: sunilrk07
3 Replies

6. 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

7. 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

8. Solaris

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.:)) (2 Replies)
Discussion started by: kurva
2 Replies

9. Shell Programming and Scripting

delete files one day old in current month only

i want to delete files that are one day old condition is files should be of current month only ie if iam running script on 1 march it should not delete files of 28 feb(29 if leap year :-)} any modifications to find $DIR -type f -atime +1 -exec rm -f{}\; (4 Replies)
Discussion started by: maverick
4 Replies

10. UNIX for Dummies Questions & Answers

listing files and directory in Page wise

!hello , Any one can me how can i display files and directory in Pagewise. how to change prompt in UNIX . (1 Reply)
Discussion started by: smdakram
1 Replies
Login or Register to Ask a Question