1 Star 1 Fork 0

wolcengit/mindoc

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
sync_host.sh 896 Bytes
一键复制 编辑 原始数据 按行查看 历史
gsw945 提交于 2021-08-31 09:59 . Update sync_host.sh
#!/bin/bash
set -eux
if ! [ -x "$(command -v rclone)" ]; then
apt install rclone -y
else
whereis rclone
fi
export MINDOC_SYNC="${MINDOC_SYNC:=}"
export SYNC_LIST="${SYNC_LIST:=}"
export SYNC_ACTION="${SYNC_ACTION:=sync --dry-run}"
export HOST_DIR=/mindoc-sync-host
export DOCKER_DIR=/mindoc
function doSyncCopy() {
if [ -d "${1}" ]
then
rclone $SYNC_ACTION --progress --exclude .git* --exclude .git/** "${1}" "${2}"
fi
}
function doSync() {
case $MINDOC_SYNC in
"docker2host")
doSyncCopy "${DOCKER_DIR}/${1}" "${HOST_DIR}/${1}"
;;
"host2docker")
doSyncCopy "${HOST_DIR}/${1}" "${DOCKER_DIR}/${1}"
;;
*)
printenv | grep MINDOC_SYNC
;;
esac
}
export IFS=";"
if ! [ -z "${SYNC_LIST}" ]; then
for item in $SYNC_LIST; do
doSync "${item}"
done
fi
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/wolcengit/mindoc.git
git@gitee.com:wolcengit/mindoc.git
wolcengit
mindoc
mindoc
zmindoc4

搜索帮助