博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
shell脚本递归压缩实践
阅读量:4670 次
发布时间:2019-06-09

本文共 477 字,大约阅读时间需要 1 分钟。

#!/bin/bashSrc_Path=/data/www/logsDst_Path=/data/www/logs_bakfor rfile in `find $Src_Path/ -depth -maxdepth 1 -type f |awk -F '/' '{print $NF}'`dotar -zcPvf $Dst_Path/$rfile.tar.gz $Src_Path/$rfiledonefor dir in `find $Src_Path/* -type d|awk -F '/' '{print $NF}'`domkdir -p $Dst_Path/$dirfor file in `find $Src_Path/$dir/ -type f|awk -F '/' '{print $NF}'`dotar -zcPvf $Dst_Path/$dir/$file.tar.gz $Src_Path/$dir/$filedonedone

  

转载于:https://www.cnblogs.com/xzlive/p/9379386.html

你可能感兴趣的文章
MySQL 处理海量数据时一些优化查询速度方法
查看>>
ubuntu 安装nginx 并开启目录浏览功能
查看>>
leetcode[94]Binary Tree Inorder Traversal
查看>>
nginx的addition模块在响应的前后报文添加内容与变量的运行原理
查看>>
Sql日期时间格式转换
查看>>
Winform中ComcoBox控件设置选定项
查看>>
chrome调试技巧
查看>>
concurrency runtime学习笔记之二:并行
查看>>
python基础(三)
查看>>
GraphQL实战经验和性能问题的解决方案
查看>>
MySql大数据量恢复
查看>>
java-字符串反转
查看>>
获取一个目录下的所有文件
查看>>
微软发布Sample Browser for Windows 8版:5000示例代码,"触手可及"
查看>>
Windows 10 使用问题
查看>>
linux xargs命令
查看>>
用CSS3实现图像风格
查看>>
转载--黎曼
查看>>
mysql的建表语句
查看>>
免费的HTML5版uploadify
查看>>