Skip to content

Instantly share code, notes, and snippets.

@JeffreyVdb
Last active February 8, 2016 08:59
Show Gist options
  • Save JeffreyVdb/621c903e8779c64cb99c to your computer and use it in GitHub Desktop.
Save JeffreyVdb/621c903e8779c64cb99c to your computer and use it in GitHub Desktop.
Relaxing logrotate compression
/var/log/*.log {
weekly
rotate 26
compress
compresscmd "/usr/local/bin/xzuwsgi"
uncompresscmd "/usr/local/bin/unxzuwsgi"
compressext .xz
missingok
notifempty
copytruncate
}
#!/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