Advertisement
Hightension

Untitled

Jan 29th, 2016
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. #!/bin/bash
  2. if [[ "$1" == "--help" ]] ; then
  3. echo "Usage: ./make_megalog.sh LOG_DIRECTORY OUTPUT_FILE"
  4. echo "ex: ./make_megalog.sh /home/person/spigot/logs megalog.log"
  5. echo "Reads through compressed logs in the log directory and"
  6. echo "concatenates them into a file."
  7. exit 0
  8. elif (( "$#" < 2 )) ; then
  9. echo "This script takes two arguments! Please supply the log directory and the output file. "
  10. echo "If you want some help, type ./make_megalog.sh --help"
  11. exit -1
  12. else
  13. for file in "$1"/*.log.gz
  14. do
  15. gzip -c -d $file >> "$2"
  16. done
  17. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement