C++代码
- ### 由本地向服务器推送
- rsync -avz --port=8730 dist.tar.gz liuxinxiu@127.0.0.1::test
- rsync -avzP --port=8730 dist.tar.gz dynamicAssets.json jenkins@172.16.207.22::work-litigation
- ### 由服务器向本地下载
- rsync -avz liuxinxiu@127.0.0.1::test /test/111
- rsync -avz jenkins@172.16.207.22::work-litigation /var/www/html/mirrors/frontend/injured/work-litigation
- ### 创建软连接(前边是存储源——后边是软链接)
- ln -s /data/apps/rsync/www/release /data/apps/nginx/htdocs/release
以下是具体是例子:
C#代码
- ### 由本地向服务器推送
- cd /data/apps/nginx/htdocs/$projectPath/upload
- rsync -avzP --port=8730 dist.tar.gz dynamicAssets.json jenkins@172.16.207.22::$las_dir
- ### 由本地向服务器推送
- cd /data/apps/nginx/htdocs/$projectPath/upload
- rsync -avzP --port=8730 dist.tar.gz dynamicAssets.json jenkins@172.16.207.22::release/$projectPath &&
- cd /data/apps/rsync/www/release/$lat_dir &&
- scp -r $pat_dir root@10.10.9.99:/var/www/html/mirrors/frontend/$pat_dir &&
- curl http://10.10.9.99/frontend/$projectPath