IT博客汇
  • 首页
  • 精华
  • 技术
  • 设计
  • 资讯
  • 扯淡
  • 权利声明
  • 登录 注册

    Copy sparse directory over ssh

    lesca发表于 2019-07-22 13:30:47
    love 0

    scp can copy directory over ssh, but sparse parameter is not supported (unlike cp).

    To efficiently copy directory with sparse files, use tar and ssh instead.

    # Copy "images" directory to remote server 
    tar -cvSf - images/ | ssh user@remoteHost "(cd /mnt/pve/vmdata/ ; tar -xf -)"
    
    • S – stands for sparse

    tarscp.sh script

    Use tarscp.sh to transfer directory over network:

    Usage:
    tarscp srcDir/ user@host:/dest/dir/
    

    You can find the script from my github
    Direct download link for raw file: tarscp.sh



沪ICP备19023445号-2号
友情链接