Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Or use a more appropriate tool for the job.' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Or use a more appropriate tool for the job.
Authored by: regeya on Sep 04, '06 01:38:44PM

Not sure *entirely* what you mean, but look in your find manpage for -maxdepth and -type. It may not be called -maxdepth in Tiger's 'find' (one of the bad things about 'standard' command-line utils is that they differ across platforms.) It may be necessary to do this in a couple of lines, which would mean a shellscript, but that's certainly OK.

I have a positively ancient OS 9.x/ASIP installation on which I boot an OS X boot CD once a month and run a shellscript that finds all files modified in the last month that are under 20MB in size, and then I ditto the files, delete the originals, and move the dittoed file into place. It takes very little time and really keeps file fragmentation down. It also made for a ridiculously small shellscript.

BTW, am I thinking right that the original Ruby script could be shortened extensively by using routines from rake?



[ Reply to This | # ]
Or use a more appropriate tool for the job.
Authored by: pinguru on Sep 06, '06 07:05:47AM

Any chance you could post the script? I have been tinkering with something like this for a while but to no avail (no shell scripting experience).

Cheers



[ Reply to This | # ]
Or use a more appropriate tool for the job.
Authored by: darsan on Sep 21, '06 10:56:34AM

I use the following command to clean out old home folders on multi-user workstations:

find /Users -maxdepth 1 -mindepth 1 -mtime +30 -type d ! -name Shared ! -name admin | xargs -n 100 rm -Rd

Change the -mtime option to + however many days you need, adjust the user directories you want to exclude at the ! -name options, for xargs it can be changed as needed. This makes a nice periodic launchd/cron script.



[ Reply to This | # ]