备份日志脚本

#!/bin/bash

l="/home/weblogs/rtppublisher/logcollection.log* /home/weblogs/rtppublisher2/logcollection.log*"

a=0
D=$(pwd)
name=$(hostname | grep -o "media..")
for i in $l
do
a=$(expr $a + 1)
cd $(dirname $i)
sudo tar zcf ${D}/logcollection_${a}.tar.gz $(basename $i)

done

cd ${D}
tar zcf ${name}_logcollection.tar.gz logcollection_*
rm -f logcollection_*

# tar_logcollection_log.sh




# hexo new '备份日志脚本'

# hexo clean all
# hexo ge
# hexo de
# hexo clean