Advertisement
Guest User

logrotate

a guest
Jan 8th, 2012
267
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. # nicenesses range from -20 (most favorable scheduling) to 19 (least favorable)
  4. NICE=19
  5.  
  6. # 0 for none, 1 for real time, 2 for best-effort, 3 for idle
  7. IONICE_CLASS=2
  8.  
  9. # 0-7 (for IONICE_CLASS 1 and 2 only), 0=highest, 7=lowest
  10. IONICE_PRIORITY=7
  11.  
  12. CMD_LOGROTATE="/usr/sbin/logrotate /etc/logrotate.conf"
  13.  
  14. if [ -x /usr/bin/nice ]; then
  15. CMD_LOGROTATE="/usr/bin/nice -n ${NICE:-19} ${CMD_LOGROTATE}"
  16. fi
  17.  
  18. if [ -x /usr/bin/ionice ]; then
  19. CMD_LOGROTATE="/usr/bin/ionice -c ${IONICE_CLASS:-2} -n ${IONICE_PRIORITY:-7} ${CMD_LOGROTATE}"
  20. fi
  21.  
  22. ${CMD_LOGROTATE}
  23.  
  24. exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement