标签:tar 压缩 打包 日志
#!/bin/bash
ls ./ > /tmp/lsname.txtcat /tmp/lsname.txt |grep -v ".gz$" > /tmp/newlsname.txt
for i in cat /tmp/newlsname.txt;dotar -czf $i.tar.gz $iif [ $? = 0 ];thenrm -f $ielseecho ‘2‘ fidone
cat /tmp/newlsname.txt
压缩目录中部分文件的脚本
原文地址:http://blog.51cto.com/xiaoahehe/2129050