Created
August 4, 2011 22:03
-
-
Save anveo/1126412 to your computer and use it in GitHub Desktop.
Reset logs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cat /dev/null > /var/www/api/shared/log/god.log | |
cat /dev/null > /var/www/api/shared/log/nginx_access.log | |
cat /dev/null > /var/www/api/shared/log/unicorn.stderr.log | |
cat /dev/null > /var/www/api/shared/log/unicorn.stdout.log | |
cat /dev/null > /var/www/api/shared/log/resque.log | |
cat /dev/null > /var/www/api/shared/log/production.log | |
# resync logs | |
kill -s USR1 `ps -ef | sed -n '/unicorn_rails master/{/grep/!p;}' | awk '{print$2}'` | |
kill -s HUP `ps -ef | sed -n '/resque:scheduler/{/grep/!p;}' | awk '{print$2}'` | |
# everything else??? | |
for logs in `find /var/log -type f`; do > $logs; done | |
find /var/log -type f -name "*.gz" |xargs rm -f | |
find /var/log -type f -name "*.1" |xargs rm -f | |
find /var/log -type f -name "*.0" |xargs rm -f |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment