Advertisement
ivanich

clean carbon logs

Mar 9th, 2017
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.38 KB | None | 0 0
  1. cat clean-carbon-logs.sh
  2. #!/bin/bash
  3.  
  4. # Because graphite has now way to configure the logrotation,
  5. # we do that with a cronjab and this script.
  6.  
  7. CARBON_LOGS=/var/log/graphite/carbon-cache/
  8.  
  9. # gzip log files older than 3 days
  10. #find $CARBON_LOGS -type f -mtime +3 -exec gzip -q "{}" \;
  11. # removes log files older than 360 days
  12. find $CARBON_LOGS -type f -ctime +360 -exec rm "{}" \;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement