【问题标题】:Remote dd backup with ssh使用 ssh 进行远程 dd 备份
【发布时间】:2013-10-16 02:52:29
【问题描述】:

我目前正在使用dd、gzip和nc的组合来远程备份一个arm板的flash。

dd if=/dev/nand conv=sync,noerror bs=64K | gzip -c -9 |数控 192.168.0.123 8000

我想问一下是否有一种有效的方法可以省略nc并通过ssh传输数据。

此外,我还在寻找由“备份服务器”启动备份过程的解决方案。

【问题讨论】:

    标签: unix ssh dd


    【解决方案1】:

    类似的东西?

    dd if=/dev/nand conv=sync,noerror bs=64K | gzip -c -9 | ssh user@server 'cat - > backup.gz'
    

    【讨论】:

    • 看起来不错。我在问题中添加了另一个场景。
    • ssh user@board 'dd if=/dev/nand conv=sync,noerror bs=64K | gzip -c -9' > 备份.gz;这应该可行,对吧?
    • 您也可以将 -C 标志添加到您的 ssh 命令中。这将在 ssh 连接中启用压缩
    【解决方案2】:

    我不太确定同步是一个很好的转换标志。 dd 手册页说:

       sync   pad  every  input block with NULs to ibs-size; when used with block or unblock, pad
              with spaces rather than NULs
    

    我不认为你想填充任何东西。也许这本来是要传递给 iflags 的:

       dsync  use synchronized I/O for data
    
       sync   likewise, but also for metadata
    

    或者直接代替:

       direct use direct I/O for data
    

    这在我的 Cubieboard2 的 nand 上稍快。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-12-14
      • 1970-01-01
      • 1970-01-01
      • 2021-06-06
      • 2019-03-11
      • 1970-01-01
      • 1970-01-01
      • 2015-01-19
      相关资源
      最近更新 更多