标签:log dep ash done shel pre awk 脚本 data
#!/bin/bash Src_Path=/data/www/logs Dst_Path=/data/www/logs_bak for rfile in `find $Src_Path/ -depth -maxdepth 1 -type f |awk -F ‘/‘ ‘{print $NF}‘` do tar -zcPvf $Dst_Path/$rfile.tar.gz $Src_Path/$rfile done for dir in `find $Src_Path/* -type d|awk -F ‘/‘ ‘{print $NF}‘` do mkdir -p $Dst_Path/$dir for file in `find $Src_Path/$dir/ -type f|awk -F ‘/‘ ‘{print $NF}‘` do tar -zcPvf $Dst_Path/$dir/$file.tar.gz $Src_Path/$dir/$file done done
标签:log dep ash done shel pre awk 脚本 data
原文地址:https://www.cnblogs.com/xzlive/p/9379386.html