Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- if [[ "$1" == "--help" ]] ; then
- echo "Usage: ./make_megalog.sh LOG_DIRECTORY OUTPUT_FILE"
- echo "ex: ./make_megalog.sh /home/person/spigot/logs megalog.log"
- echo "Reads through compressed logs in the log directory and"
- echo "concatenates them into a file."
- exit 0
- elif (( "$#" < 2 )) ; then
- echo "This script takes two arguments! Please supply the log directory and the output file. "
- echo "If you want some help, type ./make_megalog.sh --help"
- exit -1
- else
- for file in "$1"/*.log.gz
- do
- gzip -c -d $file >> "$2"
- done
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement