On 21 Jun 2006, at 21:18 , Peter N Lewis wrote:
For future reference, why not turn on BBEdit's backup files.

Sure, you end up with a folder with 40,000 files taking up 2.5Gig, but it would have saved you this time...

10 5 1 * * find $HOME/Documents/.backups/ -atime +60 -print0 | xargs -0 rm

(at 05:10 on the first of the month, find all the files in the backup directory that haven't been accessed in 60 days, print0 them (to avoid problems with spaces) and toss them at rm)

BTW, watch out for using access time. It my mucking around with my script, I found that many files had exactly the same access time. I changed over to modified time and they were all different, and much larger (many files that had been created a year ago had (often identical) access times in the last couple months). I suspect that could be Spotlight, or running a complete backup, or some other process that accesses all files.

In this case, its no big deal, it would just leave some extra backup files to be deleted next month (although if you did a complete backup once a month it might render the cron job useless). In other cases, this unexpected change of access time could cause serious problems.

Enjoy,
   Peter.

--
Check out Interarchy 8.1, just released, now with Amazon S3 support.
<http://www.stairways.com/>  <http://download.stairways.com/>

--
------------------------------------------------------------------
Have a feature request? Not sure the software's working correctly?
If so, please send mail to <[EMAIL PROTECTED]>, not to the list.
List FAQ: <http://www.barebones.com/support/lists/bbedit_talk.shtml>
List archives: <http://www.listsearch.com/BBEditTalk.lasso>
To unsubscribe, send mail to:  <[EMAIL PROTECTED]>

Reply via email to