![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| HP-UX HP-UX (Hewlett Packard UniX) is Hewlett-Packard's proprietary implementation of the Unix operating system, based on System V. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| delete file older than N days | ericaworld | Shell Programming and Scripting | 7 | 02-21-2008 08:34 AM |
| delete files and folders older than 3 days | melanie_pfefer | Shell Programming and Scripting | 7 | 12-18-2006 12:58 PM |
| Need to remove files older than 30 days except directories | malaymaru | Shell Programming and Scripting | 6 | 11-13-2006 11:50 PM |
| How can I delete files older than 7 days? | odogbolu98 | UNIX for Dummies Questions & Answers | 3 | 02-26-2002 08:35 PM |
| delete files older than 7 days | lesstjm | UNIX for Dummies Questions & Answers | 1 | 11-06-2001 10:43 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Command for delete the directories which are older than 7 days
Hi,
My requirement is need to delete the directories (Including files also) which are older than 7 days. So I used below command in one script (script takes 2 input parameters) #$1 - Path of the directory from where we have to delete the directories.# #$2 - Number of days older directories to be deleted# find $1 -type d -mtime +$2 -exec rm -r {} \; The issue is this command is working fine, but when it deletes directory(Ex: XYZ directory) after some time(after 12 hrs) again XYZ gets created with different modification time and this directory is showing some size(Actually this directory files are deleting). So the question is why this directory is recreating? actually we do not want it. Please let me know if any body have same experience in past. Thanks |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|