Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I like to store ichat transcripts for a few days so that if I forget something referenced in a chat I can refer back to it. However, after a week or so, I would prefer these transcripts be deleted. Is it possible to automate this process? How?

share|improve this question
In what format are iChat logs stored on disk? Maybe it's just a simple find program call scheduled using cron or a Launch Agent. What have you tried so far? – Daniel Beck Mar 29 '13 at 18:59
up vote 1 down vote accepted

I guess there are many ways, but because OSX is UNIX based you can use the good ol' crontab and some bash scripting.

  • Create a script Make sure it has execute rights.

Code inside the sh file:


find "~/Documents/iChats" -type f -mtime +$days_old -exec rm -f {} \;
  • Add the script to your user crontab to run each hour (I guess you don't keep your computer open all day, so if it misses one hour it will delete your old files the next hour).

Open crontab configuration:

crontab -e

Add and save:

0 * * * * <path to>
share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .