Last active
February 8, 2016 08:59
-
-
Save JeffreyVdb/621c903e8779c64cb99c to your computer and use it in GitHub Desktop.
Relaxing logrotate compression
This file contains 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
/var/log/*.log { | |
weekly | |
rotate 26 | |
compress | |
compresscmd "/usr/local/bin/xzuwsgi" | |
uncompresscmd "/usr/local/bin/unxzuwsgi" | |
compressext .xz | |
missingok | |
notifempty | |
copytruncate | |
} |
This file contains 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
#!/bin/bash | |
PROG_CMD_NAME=$(basename $0) | |
NICE=/usr/bin/nice | |
IONICE=/usr/bin/ionice | |
if [[ -L $0 ]]; then | |
[[ ${PROG_CMD_NAME:0:2} == "un" ]] && XZ=/usr/bin/unxz || XZ=/usr/bin/xz | |
else | |
XZ=/usr/bin/xz | |
fi | |
echo exec $NICE -n 19 $IONICE -c2 -n7 $XZ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment