Skip to content

Instantly share code, notes, and snippets.

@DogeVenci
Last active August 30, 2018 03:23
Show Gist options
  • Save DogeVenci/3b721c5d5be094fa3535252c655ceb11 to your computer and use it in GitHub Desktop.
Save DogeVenci/3b721c5d5be094fa3535252c655ceb11 to your computer and use it in GitHub Desktop.
[备份并上传百度] #shell #backup #baidu
BACK_DIR="/data/discuz"
WORK_DIR="/root/discuz_backup"
discuz_DATA=discuz_$(date +"%Y%m%d").tar.gz
if [ ! -d $WORK_DIR ];
then
mkdir -p "$WORK_DIR"
fi
cd $WORK_DIR
rm ./*.tar.gz
tar zcvf - $BACK_DIR |openssl des3 -salt -k 密码 |dd of=$discuz_DATA
./bpcs_uploader.php upload $discuz_DATA $discuz_DATA
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment