未古其人

目录

自动化压缩

#!/bin/bash
inputPara=$1
pkgingTime=$(date +%s)
folderNames=("racoam" "siteoam" "nodeoam")

mkdir ./out/

for folderName in ${folderNames[@]}
do
    if [[ $folderName == $inputPara || $inputPara == "" ]]
    then
        cd ${folderName}/
        tar -zcvf ${folderName}_${pkgingTime}_gucwei.tgz opt/ etc/
        mv ${folderName}_${pkgingTime}_gucwei.tgz ../out/
        cd ..
    fi
done