Skip to content

Instantly share code, notes, and snippets.

@chrisdroukas
Created August 8, 2013 15:31
Show Gist options
  • Select an option

  • Save chrisdroukas/6185663 to your computer and use it in GitHub Desktop.

Select an option

Save chrisdroukas/6185663 to your computer and use it in GitHub Desktop.
1. Create free.sh 2. crontab -e 3. */30 * * * * /Users/username/free.sh Via http://stackoverflow.com/questions/15216950/how-to-cron-purge-on-mac-os-lion
#!/bin/bash
free=`vm_stat | grep free | awk '{print $3}'`
freer=${free%%.*}
if [ "$freer" -lt "18000" ]
then
nice purge
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment