Delete files from sub-directories over 7 days


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Delete files from sub-directories over 7 days
# 1  
Old 12-05-2008
Delete files from sub-directories over 7 days

Can any one please help me in deleting all the Files over 7 days from sub-directories A, B, C...

Top-Directory
Sub-Directory-A
File-1
File-2
.....
File-n
Sub-Directory-B
File-1
File-2
.....
File-n
Sub-Directory-C
File-1
File-2
.....
File-n
Sub-Directory-Z
----
----
# 2  
Old 12-05-2008
Search for find old files with the Google Custom Search right above this page, there are a lot of threads regarding this topic.

Regards
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Delete files 30 days old

Will this work to delete files 30 days old in $backupDir or is there a better way to do it? find $backupDir -type f -mtime +30 -exec rm {} \; (2 Replies)
Discussion started by: wyclef
2 Replies

2. Shell Programming and Scripting

Need Help in ksh Script to list files older than 365 days from specified directories

Requirement is to list the files older than 365 days from multiple directories and delete them and log the list of files which are deleted to a log file. so 1 script should only list files older than 365 days for each directory separately to a folder The other script should read these files... (7 Replies)
Discussion started by: prasadn
7 Replies

3. Shell Programming and Scripting

Find directories only and delete them created 3 days before

Hello I have some directories and files created under /export/local/user I would like to delete directories only under /export/local/user, created before 3 days Can someone help me with command to do this task? Thanks (4 Replies)
Discussion started by: needyourhelp10
4 Replies

4. Shell Programming and Scripting

Using cron to delete directories 90 days old

We use Solaris 10 x86 and I want to use a cron job to remove directories +90 old. Currently I have the command below but it only cleans the files and keeps the directory. What am I doing wrong? /opt/tesk/batch/kit/archive/* -mtime +90 -exec rm -r {} \: Thank you (3 Replies)
Discussion started by: oh-daa
3 Replies

5. Red Hat

Find files older than 30 days in directories and delete them

Hi, I have dummies questions: My script here can find the files in any directories older than 30 days then it will delete the files but not the directories. I would like to also be able to delete the directories that hold old files more than 30 days not just the files itself. find . -type f... (2 Replies)
Discussion started by: lamoul
2 Replies

6. UNIX for Dummies Questions & Answers

Delete files older than 30 days

This is driving me crazy. How can I delete files in a specifc directory that are over 30 days old? Thanks in advance. (3 Replies)
Discussion started by: tlphillips
3 Replies

7. HP-UX

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... (1 Reply)
Discussion started by: sridhar sivakot
1 Replies

8. Shell Programming and Scripting

Need to remove files older than 30 days except directories

Hi, I need to remove files (*.trc) which are older than 30 days from one location. My problem is there I do not want to visit any of the directories at that location. I want to search files at that particular location only (need to skip directorys at that location). maxdepth option is there... (6 Replies)
Discussion started by: malaymaru
6 Replies

9. UNIX for Dummies Questions & Answers

How to delete files over 30 days

I have a directory that contains files. I would like the command that deletes all files that are over 30 days old. Delete files based on creation date and not modified. (2 Replies)
Discussion started by: GEBRAUN
2 Replies

10. UNIX for Dummies Questions & Answers

How to delete files which are 7 days old

Hi all, how to write a script that will indentify the files in a directory which are 7 days old and delete those files. Thanks in advance Cheers Arunava (8 Replies)
Discussion started by: arunava_maity
8 Replies
Login or Register to Ask a Question