Journal Kymermosst's Journal: Let me save you $10 5
I was browsing around freshmeat and found this little gem of a shareware program.
Here's the scoop from the description page. For only $10 you get:
General:
* Delete ALL files (in the specified directory) with file dates older than the specified days.
* For Unix/Linux system only.Features:
* E.g. Delete all files older than 30 days - regardless of the permission setting of the files.
* Can be run manually from browser, telnet or automatically using crontab.
* Support deletion of files in multiple folders and of different ages.
* Only two variables to edit - the directory and the file age.Requirement:
* Perl
* No MySQL needed.
* No SSI needed.
Here's what they are charging $10 for. Only they've written it in perl.
--- BEGIN CUT HERE ---
#!/bin/sh
DIR=/path/to/directory
AGE=30
find $DIR -mtime +$AGE -exec rm -f {} \;
--- END CUT HERE ---
Only two variables to edit, deletes everything in the specified directory (DIR) older than AGE days. You can even do multiple directories with different ages by deleting the DIR= and AGE= and copying the find command a few times, substituting the values in for $DIR and $AGE. You can run it as-is from telnet, and from cron, and by adding "echo Content-type: text/plain ; echo" at the top, it might even run as CGI.
Oh, and you can have the above for free. But if you want to send me $10 for all 10 seconds that took to write, be my guest.
Moo (Score:2)
Subject (Score:2)
Re: (Score:2)
On a more serious note (Score:2)
I frequently want to do something (could be anything) to the files listed by a find command. I've usually done something like for i in `find ...`; do ... $i; done, but that chokes if the filenames returned by find include spaces or certain other characters. I didn't know there was an option to have find run arbitrary commands with its output, and it looks like it handles all filenames properly. Sweet!
Re: (Score:2)