#!/bin/bash
date=$(date +%Y-%m%d%H)
bak_path=/application/bs_bak/static
project_path=/www
tmp_path=/tmp/statics
RETVAL=0
# static
test -d "$bak_path" && echo "$bak_path exists" || mkdir "$bak_path" -p
cd $project_path
echo $"Usage: $0 {lngiot-AdminWeb|lngiot-seed|lngiot-view}"
read -p "Enter your tar project:" tar_project
# tar project=(lngiot-AdminWeb,lngiot-seed,lngiot-view)
if [ -d "$project_path/$tar_project" ];then
tar zcf "${tar_project}_${date}".tar.gz ${tar_project}/
mv ./${tar_project}_${date}.tar.gz $bak_path/
else
echo "$project_path/$tar_project is exists"
fi
2016-11-16
文件批量备份脚本
评论
发表评论
姓 名: