Skip to content

Instantly share code, notes, and snippets.

@tjl2
Created September 18, 2010 14:23
Show Gist options
  • Save tjl2/585716 to your computer and use it in GitHub Desktop.
Save tjl2/585716 to your computer and use it in GitHub Desktop.
cd /var/log/engineyard/mongrel/ecr
f=production.log
mv $f $f.tmp && touch $f && chown ecr:ecr $f && monit restart all -g ecr && gzip -c $f.tmp > /data/old_logs/`hostname`/mongrel/ecr/$f-`date +%Y%m%d-%H:%M`.gz && rm $f.tmp
cd /var/log/engineyard/nginx
f=ecr.access.log
mv $f $f.tmp && touch $f && kill -HUP `cat /var/run/nginx.pid` && gzip -c $f.tmp > /data/old_logs/`hostname`/nginx/$f-`date +%Y%m%d-%H:%M`.gz && rm $f.tmp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment