Catch up on stories from the past week (and beyond) at the Slashdot story archive


Forgot your password?
DEAL: For $25 - Add A Second Phone Number To Your Smartphone for life! Use promo code SLASHDOT25. Also, Slashdot's Facebook page has a chat bot now. Message it for stories and more. Check out the new SourceForge HTML5 Internet speed test! ×
The Internet

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:


        * Delete ALL files (in the specified directory) with file dates older than the specified days.
        * For Unix/Linux system only.


        * 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.


        * Perl
        * No MySQL needed.
        * No SSI needed.

Here's what they are charging $10 for. Only they've written it in perl.

  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.

This discussion has been archived. No new comments can be posted.

Let me save you $10

Comments Filter:
  • by ncc74656 ( 45571 ) *
    With its reputation for enabling code that is barely distinguishable from line noise, Perl is the perfect choice for such an app...if you're trying to sell it. It makes it harder for the unwashed masses to tell just how badly you've just ripped them off. :-)
  • Yes, but do you offer lifetime free upgrades & support? :)
    • If I ever think of a way to do it more efficiently and produce a new version, I'll be sure to post it in my journal...
  • find $DIR -mtime +$AGE -exec rm -f {} \;

    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!

    • I know a few more find tricks. I use Samba to serve files, several Windows clients connect. Check out my incremental virus scan of /home using F-prot for Linux workstations [] (free as in beer)... only scans directories that changed since yesterday:

      SCANDATE=`date +"%D"`
      if [ -x /usr/local/f-prot/tools/ ]; then
      UPDATE=`/usr/local/f-prot/tools/ -cron`
      if [ -n "$UPDATE" ]; then

A university faculty is 500 egotists with a common parking problem.