Gossamer Forum
Home : General : Perl Programming :

Script needed...

Quote Reply
Script needed...
I need a script that when ran via cron will delete certain files that are older than X date.

Needs to run on several directories.

One directory I want "purged" has files that look like 41407+913028567. There are also some files in here that I don't want deleted. Other directories I want "purged" only have files that can be deleted.

Anyone know of such a beast? Thanks!


Quote Reply
Re: Script needed... In reply to
While I am not aware of an actual program that does this sort of thing, this is actually what Perl was designed to do originally. Basically, you should create a simple script that is capable of reading in a small database of directory info for each area you need file maintenance in. Next, I would store a regular expression that I would use for pattern matching files in that directory and execute an RM for either that pattern or for filenames that were found that matched the pattern. Depending on the depth of functions you would need, this program might get quite complex, or stay fairly simple.


------------------
Fred Hirsch
Web Consultant & Programmer
Quote Reply
Re: Script needed... In reply to
Fred, appreciate your advice but I am not a programmer and not sure what you mean. I guess that if there is no "off the shelf" solution I should be looking for a programmer (interested?). In regards to your last note, I hope that this can "stay fairly simple". Thanks again!