脚本定期清理日志

 

scrollLog.sh

 

#!/bin/bash

cd `dirname $0`
PWD_DIR=`pwd`

echo $PWD_DIR

SIZE=`du nohup.out | cut -f 1`
echo $SIZE
if [ $SIZE -gt 20000 ]; then
        >nohup.out
        echo `du nohup.out`
fi

你可能感兴趣的:(脚本)