Skip to content

Instantly share code, notes, and snippets.

@jlecour
Created December 6, 2013 10:21
Show Gist options
  • Save jlecour/7821571 to your computer and use it in GitHub Desktop.
Save jlecour/7821571 to your computer and use it in GitHub Desktop.
A small shell script to remove useless logs (other environments than development) and truncate all other log files
#!/bin/sh
for file in `ls ~/Projects/*/log/*_{production,staging,sandbox}.log`; do
rm $file
echo "remove $file"
done
for file in `ls ~/Projects/*/log/*.log`; do
echo '' > $file
echo "truncated $file"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment