Directory clean up


 
Thread Tools Search this Thread
Operating Systems AIX Directory clean up
# 1  
Old 08-24-2004
Directory clean up

I want to write a script in ksh that will delete file that are more than 2 weeks old.
# 2  
Old 08-24-2004
man find
man rm
man xargs ( if required )

cheers
ZB
# 3  
Old 08-24-2004
Computek Support

If you are on windows then go to regedit and clear the cache.
computek
# 4  
Old 08-25-2004
Re: Computek Support

Quote:
Originally posted by computek
If you are on windows then go to regedit and clear the cache.
Hmm. Two things wrong here. Firstly, the OP has posted this in the AIX forum, therefore you'd expect him/her to be having a problem with an AIX system. Also, the OP is using ksh (the Korn Shell), and my post is factually correct in that a solution can be formed from the find (with atime, ctime or mtime used as appropriate), rm and (if there are a lot of files) xargs commands. I have directed the OP towards the appropriate manpages so that they can research the solution themselves. But the command required would be something like
Code:
find /somedir -mtime +14 | xargs rm

Secondly (and as off-topic as it is), there is no cache in the Windows registry. These are primarily UNIX boards, although there is a forum for the discussion of Windows and DOS topics which can be reached
here .

Cheers
ZB
# 5  
Old 08-25-2004
Thanks everyone. I appreciate your inputs.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to clean 3 days before files, from a directory?

I have a Solaris System. I am using bash shell. I want to prepare a script which can do the below. There are few directories i need to clean. In those directories, I need to delete files which are older than 3 days. 3 days before files need to be deleted. The directories are as follows.... (7 Replies)
Discussion started by: Saidul
7 Replies

2. Shell Programming and Scripting

Clean up the space

Hi I just want to clean up the space in UNIX. Is there any special command that does this process or do I need to manually type the following rm <filename> Any help would be really appreciated. Thanks (2 Replies)
Discussion started by: bobby1015
2 Replies

3. UNIX for Advanced & Expert Users

Clean up Scripts

Hi i have a perl script that i use to clean up empty folders on our server. I need to make a amendment to this to exclude certain folders. Folders are invisible to end users but must not be cleaned up by this script. folders i need protecting have unique names .Highres .HighresF .Lowres... (0 Replies)
Discussion started by: treds
0 Replies

4. Shell Programming and Scripting

How to clean this script?

Hello guys, this script partially works but it's still pretty ugly and, moreover, if the month is jan/feb/mar... it doesn't work at all. Could anyone say me how to correct, cut and clean a little bit? #!/usr/bin/ksh egrep -v -e "^\s*#" /file/permission | awk '{ print $1 }' | sort | uniq... (3 Replies)
Discussion started by: gogol_bordello
3 Replies

5. AIX

How to clean PV id?

When I run command: >chdev -l hdisk1 -a pv=clear It shows Method error (/etc/methods/chgdisk): 0514-062 Cannot perform the requested function because the specified device is busy. run: #>fuser -kxuc /dev/raw1 /dev/raw1: How to clean PV id? (4 Replies)
Discussion started by: rainbow_bean
4 Replies

6. UNIX for Dummies Questions & Answers

Help me clean this up

UNIX amature/novice. I've written a script (it works) that needs to be cleaned up. I'm searching for a way to perform a "go to , perform this then return" section of code. The books I have and searches i"ve done so far do not show me how to do this. I've pasted in the current code below. I've... (1 Reply)
Discussion started by: scanner248
1 Replies

7. Shell Programming and Scripting

clean /etc/hosts

hi all, i need to write a script. it should be able to clean the /etc/hosts file like this: first field is the ip (what else ;)) second field is the fqdn (full qualified domain name) third field is the hostname the fourth to n'th field is the rest. i hope you understand what is needed?... (5 Replies)
Discussion started by: DukeNuke2
5 Replies

8. Shell Programming and Scripting

clean up script

I have a script which would monitor a given directory and delete any files which are older than 10 days. I was going to set the 10 crob jobs to perform this operation for 10 different directories (some are actually sub-directories), but my boss doesn't like that idea, so I need to do that in one... (1 Reply)
Discussion started by: mpang_
1 Replies

9. Shell Programming and Scripting

writing script to clean up a directory

I have to do a directory clean up on several machines. The task is as follows: go to a particular directory (cd /xxx) 1. create a directory ' SCRIPTCLEANUP ' ( i KNOW IT) loop through 2. List the directory 3. if directory and start with 'DQA' leave it, 4. if directory or file move it to... (0 Replies)
Discussion started by: ajaya
0 Replies
Login or Register to Ask a Question