rsyncのデフォルトの使用法、期待どおりにバックアップされない

rsyncのデフォルトの使用法、期待どおりにバックアップされない

私はこれをやっています:

rsync ~/Desktop/files/ /media/myDrive/ -vbrh --progress

再帰バックアップの場合(-b)(-r)。また、進行状況バーと一緒に人間が読むことができる詳細な出力を要求します。

これで、ファイルを変更したりファイルを~/Desktop/filesサブディレクトリに移動したりすると、変更されたファイルは1つだけではなく、ファイル全体がバックアップされます。

私にどんなアドバイスを与えることができますか?

添付:

たとえば、私は多くのウェブサイトを見て、彼らが[HowToGeek][1]使用しているロゴに少し混乱していました。

ベストアンサー1

さて、私の考えでは、あなたの問題は-b選択に依存していると思います。男性の場合:

   -b, --backup
          With this option, preexisting destination files are renamed as each file is transferred or deleted.  You can control where the backup file goes and what (if  any)  suffix
          gets appended using the --backup-dir and --suffix options.

          Note  that  if  you  don’t specify --backup-dir, (1) the --omit-dir-times option will be implied, and (2) if --delete is also in effect (without --delete-excluded), rsync
          will add a "protect" filter-rule for the backup suffix to the end of all your existing excludes (e.g. -f "P *~").  This will prevent previously backed-up files from being
          deleted.   Note  that if you are supplying your own filter rules, you may need to manually insert your own exclude/protect rule somewhere higher up in the list so that it
          has a high enough priority to be effective (e.g., if your rules specify a trailing inclusion/exclusion of ’*’, the auto-added rule would never be reached).

ファイルを同期するたびに、ファイルを再同期し、~古いファイル名にサフィックス(file〜)を追加します。

あなたの最終目標が何であるかはわかりませんが、バックアップのみが必要な場合は、~/Desktop/files/次の方法を使用してください。

rsync -avP ~/Desktop/files/ /media/myDrive/

正確な一致が必要な場合(〜/デスクトップ/ファイル/に存在しなくなったファイルを削除{私の考えでは、これはあなたが探していると思います。}):

rsync -avP --delete ~/Desktop/files/ /media/myDrive/

*-P --partial --progress と同じ

おすすめ記事