Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- logfile=$1
- if [ ! -f $logfile ]; then
- echo "log files in $logfile not found "
- exit 1
- fi
- timestamp=`date +%Y%m%d`
- newlogfile=$logfile.$timestamp
- cp $logfile $newlogfile
- cat /dev/null > $logfile
- gzip -f -9 $newlogfile
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement