rsync: 复制忽略文件远程cp

 

查看目录大小:

 

du -h --max-depth=1 ./

1.9M ./lib
216K ./src
2.4G ./tmp
100K ./.idea
64K ./conf
652K ./test
248K ./plugins
12K ./__pycache__
35G ./logs
92K ./bin
37G ./

 

rsync复制忽略文件

最大为37G, 其中logs为35G,tmp为2.4G, 日志和视频文件图片文件都要忽略
cd /data/pyuser/gnews/python/v2_GNews/GNewsImg
rsync -av . /data/pyuser/gnews/python/v2_GNews/GNewsImg_20200713 --exclude logs --exclude tmp
tar -czvf GNewsImg_20200713.gz GNewsImg_20200713
tar -xzvf GNewsImg_20200713.gz
scp GNewsImg_20200713.gz root@10.13.xx.xx:/data/pyuser


例子:
cd test/
rsync -av --exclude a --exclude b . ../test2

scp GNewsImg_20200713.gz pyuser@172.23.100.3:/data/pyuser/gnews

 

posted @ 2020-07-15 14:14  Adamanter  阅读(153)  评论(0)    收藏  举报