Created
October 26, 2015 06:16
-
-
Save aminamid/5722a38b8cf29246edec to your computer and use it in GitHub Desktop.
RG zipper
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
#!/bin/bash | |
while true | |
#do fuser -a smtp*.log 2>&1 | sed -n -e 's/^\(smtp.*.log\): *$/\1/p' | xargs -i gzip {} | |
do LANG=C date | |
for f in $(ls *\.log);do echo ${f%-*} ; done | for f in $(cat /dev/stdin); do echo ${f%-*}; done | uniq | for prefix in $(cat /dev/stdin); do ls -t ${prefix}*\.log | tail -n+3 ;done | xargs -i gzip {} | |
sleep 600 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment