Skip to content

Instantly share code, notes, and snippets.

@lmacken
Last active December 14, 2015 02:28
Show Gist options
  • Save lmacken/5013514 to your computer and use it in GitHub Desktop.
Save lmacken/5013514 to your computer and use it in GitHub Desktop.
bzgrep apache logs for stuff and xz compress them over ssh to another box
bzgrep 'stuff' /var/log/hosts/app0[1-8]*/*/*/*/http/access_log.bz2 \
| cut -d':' -f2- \
| xz --compress --stdout -3 \
| ssh -c blowfish another_box \
"cat - > ~/log.xz"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment