Skip to content

Instantly share code, notes, and snippets.

@kennethkalmer
Created November 21, 2008 08:16
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save kennethkalmer/27389 to your computer and use it in GitHub Desktop.
#!/bin/bash
#
# Find all the rails projects from this directory down and clear their log
# files to save some space.
#
base=`pwd`
for path in `find $base -type f -path '*/config/environment.rb'`
do
rails_root=`echo $path | xargs dirname | xargs dirname`
echo "Found RAILS_ROOT in $rails_root"
old_pwd=`pwd`
cd $rails_root
rake log:clear
cd $old_pwd
echo
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment