|
Blue Forest http://www.lslnet.com at 11:18 on June 26, 2006
[Deleted] how one month earlier than the current date of all documents Would you, how in designated directories, delete earlier than the current system date specified time (one or two months) of all documents, because these documents will not be deleted regularly, it is occupied space.
Hope that we can give help, thank you! ! |
[Deleted] how one month earlier than the current date of all documents I have an example from the Internet to search, but I tried it has failed to implement, do not know where to write the wrong.
1s - l |while read line
Do
Month=`echo $line|awk '{print $ A/CONF.183/4' `
Day=`echo $line|awk '{print $ 7}' `
File=`echo $line|awk '{print $ 9}' `
If [$month= "Oct"]
Then
Continue
Else
Rm $file
Fi
Done |
[Deleted] how one month earlier than the current date of all documents Find dir -atime +days {} 12th -exec rm
Dir catalog
Days is the number of days |
[Deleted] how one month earlier than the current date of all documents I thank the upstairs answer.
I bak catalog is to remove the paper, I did you write this implementation, but this list also shows the bak, and suggested : rm : `bak 'is a directory
I just want to delete documents. |
[Deleted] how one month earlier than the current date of all documents Not? I am here to do good. No one said to delete the list of the country.
Operating out your copy! I see |
[Deleted] how one month earlier than the current date of all documents I later wrote in the implementation successful.
Find bak -atime 60 {} 12th -exec rm
You are talking about +days.
I can find online orders with the help :
-atime N : n days than in the past to read the file
So, I wrote directly to the -atime 60. Two months before the document is deleted. |
[Deleted] how one month earlier than the current date of all documents There should be a + support, I have the impression that |
[Deleted] how one month earlier than the current date of all documents Now it seems the effect is the same.
Thank you very much!
I was a novice and I hope the exhibitions!
Oh, I have read the articles published about you in the Forum. |
[Deleted] how one month earlier than the current date of all documents + N
N
N
Is not the same. . .
N + n is greater than
N is equal to n
N is less than n
For example :
North Korea is seven days before -mtime +7
7 is just seven days before -mtime
6-7 is just seven days -mtime |
[Deleted] how one month earlier than the current date of all documents Oh, it seems I was too superficial understanding, thank you withheld.
I again carefully try. |
[Deleted] how one month earlier than the current date of all documents I tried to delete success.
Thank you withheld. Another question to ask : atime, and ctime mtime what difference? ? ?
-atime N
"Final visit" n*24 hours before the document.
-ctime N
"Finally the time change" in the hours before the document n*24.
-mtime N
"Last revised time" in the hours before the document n*24. |
[Deleted] how one month earlier than the current date of all documents -->
Oh, you chose the wrong target, I was a novice, you want to study, the message should read netman big brother, he asked his 13 shell products. I hope you can have a good look at the course, I also need to figure N side or edge! |
[Deleted] how one month earlier than the current date of all documents Okay, thank you recommend, I would like to read properly.
We learn to work together. |
[Deleted] how one month earlier than the current date of all documents Man find |
[Deleted] how one month earlier than the current date of all documents Atime refers visit
Mean time to amend the document attributes ctime
Mtime refers to the content of the document revision time
This is something that each and every one of the basic Unix file time stamps that were recorded in the inode. |
[Deleted] how one month earlier than the current date of all documents Whether visit / attribute / revise time, but one month ago to delete the files, how to write this order? |
[Deleted] how one month earlier than the current date of all documents Find dir -atime -mtime +30 +30 +30 -ctime {} 12th -exec rm |
[Deleted] how one month earlier than the current date of all documents Find dir -atime -mtime +30 +30 +30 -ctime {} 12th -exec rm
Then delete the document containing the above conditions, I was certain conditions : (^prt*), or certain types of documents do;
Not about to change certain conditions : (^prt*), or not do certain types of documents, how to write?
Thank you! ! ! |
[Deleted] how one month earlier than the current date of all documents I wrote how a normal show why it was not in the shell script?
Find dir -atime -mtime +30 +30 +30 -ctime -name "rpt*" -print
Documents can be shown separately. Why should this be? |
[Deleted] how one month earlier than the current date of all documents I can be removed -ctime +10 anymore. Why? |
| |