压缩文件备份

清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>

#!/bin/sh

source=("../server" "../client")

target_dir="./"

date=$(date +%Y%m%d)

target="$target_dir$date.zip"

zip -qr $target ${source[0]} ${source[1]}

if [ $? = 0 ]
then
    echo "Back up SUCCESSFUL!"
else
    echo "Back up FAILED!"
fi

exit 0