recursively use scp but excluding some folders

后端 未结 6 735
庸人自扰
庸人自扰 2021-01-30 12:25

Assume there are some folders with these structures

/bench1/1cpu/p_0/image/
/bench1/1cpu/p_0/fl_1/
/bench1/1cpu/p_0/fl_1/
/bench1/1cpu/p_0/fl_1/
/bench1/1cpu/p_0         


        
6条回答
  •  南笙
    南笙 (楼主)
    2021-01-30 13:08

    You can specify GLOBIGNORE and use the pattern *

    GLOBIGNORE='ignore1:ignore2' scp -r source/* remoteurl:remoteDir
    

    You may wish to have general rules which you combine or override by using export GLOBIGNORE, but for ad-hoc usage simply the above will do. The : character is used as delimiter for multiple values.

提交回复
热议问题