#!/bin/bash #脚本出错时中断执行 set -e if [ ! -d ../logHistory ];then mkdir ../logHistory fi TIME=`date "+%Y_%m_%d_%H_%M_%S"` tar zcvf ../logHistory/${TIME}.tgz ../log rm -rf ../log/*