Example delete scripts


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Example delete scripts
# 1  
Old 03-27-2003
Question Example delete scripts

Hi People,

Does anyone have some example scripts that can be used for deleting old files from several directories. All the parameters would come from a control file containing directory path, age and file name id's.

Probably a bit to ask, but if I can be pointed in the right direction that would be great.

Cheers and Beers....uummmm Beeeerrrrrr
# 2  
Old 03-27-2003
Perhaps you could have ago at writing your own, then we could all help you when you with your struggling points.

It's not that I'm not helpful, but I'd rather see a little effort on your part. Homework questions are NOT allowed here!
# 3  
Old 03-27-2003
Cheers,

Not homework....but just the result of too much work!!!!
# 4  
Old 03-27-2003
a pointer ..

check the find command and the -*time and -exec parameters..

maybe you can do something nice with them Smilie
just be careful so you dont end up with no files left and no backups.. you do have backups right ? Smilie
have a nice one!

to get info on find use
shell> man find

/peter
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Rsync with --delete but do not delete peer dirs on target

rsync with --delete won't honor the delete if the source is something/*. I want the delete to work, but not to delete directories on the target that are peer to the intended directory. For example, using these source and target file structures: Source on desktop: ~/ Money/ ... (4 Replies)
Discussion started by: JavaMeister
4 Replies

2. Programming

Mismatched free() / delete / delete [] line no missing

Could you tell me the possibilities of the reason to get the Mismatched free() / delete / delete . I unable to see the line no in the valgrind report. it displays the function name. with that function name, I am not able to find where exactly the issue is there.I am getting the Mismatched free()... (3 Replies)
Discussion started by: SA_Palani
3 Replies

3. Shell Programming and Scripting

Script needed to delete to the list of files in a directory based on last created & delete them

Hi My directory structure is as below. dir1, dir2, dir3 I have the list of files to be deleted in the below path as below. /staging/retain_for_2years/Cleanup/log $ ls -lrt total 0 drwxr-xr-x 2 nobody nobody 256 Mar 01 16:15 01-MAR-2015_SPDBS2 drwxr-xr-x 2 root ... (2 Replies)
Discussion started by: prasadn
2 Replies

4. Shell Programming and Scripting

Calling multiple scripts from another scripts

Dear all, I am working on script which call other shell scripts in a loop but problem is from second script am not able to come out. Here is the snippet:- #!/bin/bash HSFILE=/root/Test/Components.txt LOGFile=/opt/domain/AdminDomain/application/logs... (3 Replies)
Discussion started by: sharsour
3 Replies

5. Shell Programming and Scripting

scripts to Initialise,backup,restore,delete and empty

you are to write scripts for a customer that would require a system enable the backing up of files and directories. The script should (these names should be used): 1. INITIALISE: Initialise the directory for the backup(called backup and should be in the home directory) and any other... (1 Reply)
Discussion started by: babby01
1 Replies

6. Shell Programming and Scripting

KSH - How to call different scripts from master scripts based on a column in an Oracle table

Dear Members, I have a table REQUESTS in Oracle which has an attribute REQUEST_ACTION. The entries in REQUEST_ACTION are like, ME, MD, ND, NE etc. I would like to create a script which will will call other scripts based on the request action. Can we directly read from the REQUEST_ACTION... (2 Replies)
Discussion started by: Yoodit
2 Replies

7. Shell Programming and Scripting

Changing the Bash Scripts to Bourne Scripts:URGENT

Hi, I have to write a program to compute the checksums of files ./script.sh I wrote the program using bash and it took me forever since I am a beginner but it works very well. I'm getting so close to the deadline and I realised today that actually I have to use normal Bourne shell... (3 Replies)
Discussion started by: pgarg1989
3 Replies

8. Shell Programming and Scripting

Running scripts within scripts from cron

Hi all, I have set up a cron job which calls another shell script shell script which in turn calls a Java process. The cron tab looks so. 0,30 7-18 * * 1-5 /u01/home/weblogic/brp/bin/checkstatus.sh >> /u01/home/weblogic/logs/checkstatus.log The checkstatus.sh scripts looks like this. ... (4 Replies)
Discussion started by: sirbrian
4 Replies

9. Shell Programming and Scripting

Help with Script using rsh and scripts within scripts

Hi, I've written a script that runs on a Database server. It has to shutdown the Application server, do an Oracle Dump and then restart the Application server. Its been a long time since I wrote any shells scripts. Can you tell me if the scripts that I execute within my script will be executed... (3 Replies)
Discussion started by: brockwile1
3 Replies

10. UNIX for Dummies Questions & Answers

Profile scripts versus rc scripts....

what is the difference between login and profile scripts versus the rc scripts? (1 Reply)
Discussion started by: rookie22
1 Replies
Login or Register to Ask a Question