Crafty automatic file deletion?

Crafty automatic file deletion?

Post by Jonathan I. Kame » Tue, 19 Mar 1991 12:15:47



  (I have cross-posted this response to comp.unix.questions, and directed
Followups there.  I don't really see any reason to consider this a
wizard-level discussion.)

|> [Asks if there's any utility that can parse a filename and figure out from
|>  it when to delete it.]

  The only way find is going to be able to do this is if you give it explicit
arguments for each number you want to check for; this doesn't seem to be what
you want to do.

  In general, the utilities that can do string manipulation understand nothing
at all about file modification times, and the utilities that understand mtimes
don't understand how to do any string manipulation, so you'll have to use
multiple processes to get anything approaching the functionality you're trying
to achieve, unless you write your own C program to do it.

  Or, you could use perl.  Perl can do the recursive file search, it can parse
the filenames in order to extract from them a number to check against, and it
can stat the file in order to get the modification time.  All this in one
process.

  No, I'm not going to volunteer a perl script to do this.  I'm not enough of
a perl guru to be able to throw one together in five minutes.  I'm sure
Randall or Tom or Larry will jump right in and suggest something. :-)

--
Jonathan Kamens                               USnail:
MIT Project Athena                              11 Ashford Terrace

Office: 617-253-8085                          Home: 617-782-0710

 
 
 

1. Crafty automatic file deletion?

My .logout contain a call to _find to automatically remove files
satisfying certain criteria.  I would like the file's name to provide
the criterion.  For example, files

  letter.rm.60.tex
  c_hack.rm.120.c

would be automatically removed if unmodified for 60 and 120 days.
  (Of course, I could put the specific numbers "60" and "120" into my
  call to _find.  I would like this to work, automatically, for all
  numbers that are valid to, say, the -mtime switch of _find.)
Can this be done by _find or by some other program?

Thank you.

2. open/close ports

3. Intelligent, semi-automatic file deletion?

4. Linux tape backup crash?

5. file deletion

6. Upgrade from 2.5 to 2.5.1

7. Weird file deletion problem

8. LILO & tripple boot

9. ext3 file deletion

10. file deletion protection

11. Mysterious File deletion!

12. File protection against deletion

13. Recovery from file deletion