浏览代码

diep sync

libf 2 年之前
父节点
当前提交
2b5a0877aa
共有 5 个文件被更改,包括 77 次插入0 次删除
  1. 19 0
      diepsync/Readme.md
  2. 28 0
      diepsync/diepsync.sh
  3. 5 0
      diepsync/opt/bofengtest/aaa/test.json
  4. 25 0
      env.sh
  5. 0 0
      remotecmd/packDfs.sh

+ 19 - 0
diepsync/Readme.md

@@ -0,0 +1,19 @@
+1. copy files
+   diepsync/diepsync.sh
+   diepsync/msh
+2. 调整参数
+   diepsync/diepsync.sh
+   ```
+   #Web服务器
+   export SERVER="http://27.193.12.228:8080"
+   #认证信息
+   export AUTHBS="bWV0YS5hZG1pbjphZG1pbg==" 
+   #DFS源路径
+   export DFSPATH="/opt/knowledge/DIEP/`date +%y-%m-%d`"
+   #export DFSPATH="/opt/knowledge/DIEP/2022-12-13"
+   #SFTP目标地址
+   export FTPPATH="matrix@127.0.0.1:/tmp/test"
+   #SFTP目标服务器密码
+   export FTPPASS="matrix"
+   ```
+3. 配置schedule

+ 28 - 0
diepsync/diepsync.sh

@@ -0,0 +1,28 @@
+
+#人行测试环境,参数设置
+#Web服务器
+export SERVER="http://27.193.12.228:8080"
+#认证信息
+export AUTHBS="bWV0YS5hZG1pbjphZG1pbg==" 
+#DFS源路径
+export DFSPATH="/opt/knowledge/DIEP/`date +%y-%m-%d`"
+#export DFSPATH="/opt/knowledge/DIEP/2022-12-13"
+#SFTP目标地址
+export FTPPATH="matrix@127.0.0.1:/tmp/test"
+#SFTP目标服务器密码
+export FTPPASS="matrix"
+
+#####################################################
+export LANG=zh_CN.utf8
+export LC_ALL=zh_CN.utf8
+
+#改变工作目录到当前脚本所在路径
+if [[ "$0" =~ / ]]; then cd "${0%/*}"; fi
+export PWD=`pwd`
+
+curl -X POST "${SERVER}/fs/export?issys=true" --data "srcpath=${DFSPATH}" --header "Authorization: Basic ${AUTHBS}" --output "download.zip"
+
+rm -rf ".${DFSPATH}"
+unzip download.zip
+
+./msh p="${FTPPASS}" "cd '${PWD}'" "rsync -avz '.${DFSPATH}' '${FTPPATH}'" exit

+ 5 - 0
diepsync/opt/bofengtest/aaa/test.json

@@ -0,0 +1,5 @@
+{
+    "id": 12345,
+    "idUnique": "test12345",
+    "changeSummary": "test summary info"
+}

+ 25 - 0
env.sh

@@ -0,0 +1,25 @@
+
+#环境设置
+export SERVER='http://47.92.151.165:8080'
+export AUTHBS='d2VjaXNlLmFkbWluOmFkbWlu'
+#人行测试环境
+export SERVER='http://27.193.12.228:8080'
+export AUTHBS='bWV0YS5hZG1pbjphZG1pbg=='
+
+export DFSPATH='/opt/bofengtest/aaa'
+export FTPPATH='haoba@127.0.0.1:/tmp/test'
+export FTPPASS='p0-p0-p0-'
+
+export LANG=zh_CN.utf8
+export LC_ALL=zh_CN.utf8
+
+#改变工作目录到当前脚本所在路径
+if [[ "$0" =~ / ]]; then cd "${0%/*}"; fi
+export PWD=`pwd`
+
+curl -X POST "${SERVER}/fs/export?issys=true" --data "srcpath=${DFSPATH}" --header "Authorization: Basic ${AUTHBS}" --output "download.zip"
+
+rm -rf ".${DFSPATH}"
+unzip download.zip
+
+./msh_mac "127.0.0.1" -p "${FTPPASS}" "cd '${PWD}'" "rsync -avz '.${DFSPATH}' '${FTPPATH}'" exit

remotecmd/remote/packDfs.sh → remotecmd/packDfs.sh