脚本定期清理日志

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

猜你喜欢

转载自hamber.iteye.com/blog/1745032