使用 rsync 備份到兩個位置

使用 rsync 備份到兩個位置

請原諒我的無知,我一直在尋找答案,但到目前為止卻一無所獲。

這就是我想做的:

使用 rsync 從檔案伺服器 (Ubuntu Server 14.04) 備份到 NAS 設備。備份完成後,透過 SSH 再次執行 rsync 到遠端伺服器。

我有一種揮之不去的感覺,這將無法正常工作 - 與 rsync 如何將檔案標記為已備份且自上次備份以來未更改有關。

我懷疑這可能會導致問題是否正確?

謝謝,

西蒙.

答案1

從手冊頁:

DESCRIPTION
   It [rsync] offers a  large  number  of  options
   that  control  every  aspect  of  its behavior and permit very flexible
   specification of the set of files to be copied.  It is famous  for  its
   delta-transfer  algorithm,  which  reduces the amount of data sent over
   the network by sending only the differences between  the  source  files
   and  the  existing  files in the destination.

開箱即用,無需任何特殊參數,rsync 即可完全符合您的需要:

  • 將所有差異同步到 NAS將所有差異同步到遠端 SSH 伺服器。
  • 第一次運行它時,它將在兩者上建立完整副本,然後獨立同步兩者。

即使與遠端伺服器的連線斷開,下次呼叫時它也會從中斷處繼續。

相關內容