From 5880f563e8b059ed55da07b216b3e584328346ff Mon Sep 17 00:00:00 2001 From: "iyuu.cn" <367013672@qq.com> Date: Mon, 23 Mar 2020 13:04:32 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=80=9A=E7=94=A8=E5=A4=87?= =?UTF-8?q?=E4=BB=BD=E8=84=9A=E6=9C=AC=EF=BC=8C=E5=8F=AF=E4=BB=A5=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E8=BF=9B=E8=AE=A1=E5=88=92=E4=BB=BB=E5=8A=A1=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backup.sh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 backup.sh diff --git a/backup.sh b/backup.sh new file mode 100644 index 0000000..1a0725c --- /dev/null +++ b/backup.sh @@ -0,0 +1,24 @@ +#!/bin/sh +# 传入的种子备份参数 +if [ $1 ]; then + AppName=$1 +fi + +if [ $2 ]; then + torrentDir=$2 +fi + +# 脚本当前目录 +pwddir=$(cd $(dirname $0); pwd) +# 当前日期 +DATE=$(date +%Y%m%d) +# 备份在当前目录 +backupdir=$pwddir"/"$AppName$DATE +echo "种子备份目录:"$backupdir +mkdir $backupdir -p +# 种子目录 +torrentDir=$torrentDir"/*" +# 备份 +cp -rf $torrentDir $backupdir +# 成功提示 +echo "ok"; \ No newline at end of file