#!/bin/bash
file="/export/ucinfo/shell/memory.log"
mem=`grep "used_memory:" $file | cut -d: -f2`
maxmem=`grep "maxmemory:" $file | cut -d: -f2`
number=`awk -v mem=$mem -v maxmem=$maxmem 'BEGIN{printf "%0.2f\n",mem/maxmem}'`
number01=`echo $number |awk -F "." '{print $2}'`
echo $number01
number02=75
if [ "$number01" -lt "$number02" ]
then
echo "less than 0.75"
else
echo "more than 0.75"
fi
#tar 压缩软连接文件 实际压缩真实的文件
tar -h -cvf kuang.tar.gz lnkuang.tx
解压:
tar xvf kuang.tar.gz