#! /bin/sh ### ### ### ## ## ## # # # ### ## # # # # # # ## ### # ## ### #### # # # # # # ## # # # # # # # # # ### # # ##### # # # # # # # ## ## # # # ### ### ### # # #### #### clear host="47.92.151.165" port="8080" company="wecise" auth="wecise.admin:admin1234)(*&" ctime=`date +%Y%m%d`_`date +%H%M%S` target="./m3web/${host}_${company}/${ctime}" dfs=("/app/assets" "/app/matrix/m3appstore" "/app/matrix/m3auditlog" "/app/matrix/m3config" "/assets/images" "/etc" "/home/admin" "/opt" "/script/matrix") echo echo 'M³web 应用打包**********************************************************************' echo echo '打包服务器:'${host}':'${port} echo echo '打包租户:'${company} echo mkdir -p ${target} echo '存放目录:'$target echo echo "Web前端打包开始。。。" echo #ssh matrix@"${host}" "cd /opt/matrix/web;tar czvf - --exclude=/opt/matrix/web/public/web/vendor-20200726 --exclude=.DS_Store --exclude=/opt/matrix/web/templates/matrix/test public/ templates/ " > "${target}/web.tar.gz" s/ro action=remote host="${host}" username="matrix" password="MndzWDFxYVo=" cmds='"cd /opt/matrix/web;tar czvf - --exclude=/opt/matrix/web/public/web/vendor-20200726 --exclude=.DS_Store --exclude=/opt/matrix/web/templates/matrix/test public/ templates/ " > "'${target}'/web.tar.gz"' echo echo "文件系统打包开始。。。" echo for v in ${dfs[@]} do name="dfs${v//\//_}" echo "${v}" echo curl -u "${auth}" --location --request POST "http://${host}:${port}/fs/export?issys=true&srcpath=${v}" >> "${target}/${name}.zip" echo echo done echo "合并文件系统" echo cd $target for x in dfs_*.zip do unzip -d dfs -o -u $x done zip -r dfs.zip dfs echo "删除中件文件" echo rm -rf ./dfs_*.zip rm -rf dfs echo ls -rtl echo '应用打包完成**********************************************************************'