rsync、dd、スナップショットの複数の呼び出しを処理する

rsync、dd、スナップショットの複数の呼び出しを処理する

サーバーは、次の操作を頻繁に実行します。論理ボリュームのスナップショットを取得し、その内容をリモート バックアップ サーバーにバックアップします。複数のバックアップと転送が同時に発生する可能性があります。rsync セッションとマウントされたスナップショット ボリュームが多すぎると問題になりますか? 処理時にサーバーのパフォーマンスを最適化するにはどうすればよいでしょうか?

lvcreate -L10G -s -n snapshot /home/folderA 

dd if=/mnt/snapshot bs=1M | (ssh [email protected] of=/tmp/backups bs=1M)

rsync -avzh --rsh "ssh -l username" /mnt/snapshot 192.168.1.5:/tmp/backups/  

答え1

おそらく、これらに何らかのロックを設定して、いずれが選択されても一度に 1 つのインスタンスのみが実行されるようにするのが最も安全ですが、それらをどのくらいの頻度で (どのくらいの頻度で) 実行するか、またどのくらいの時間がかかるかがわからないと、確実に判断するのは困難です。

CentOSには群れ(1)役に立つコマンドです。

[ "${FLOCKER}" != "$0" ] && exec env FLOCKER="$0" flock -en "$0" "$0" "$@" || :

          This is useful boilerplate code for shell scripts.  Put it at
          the top of the shell script you want to lock and it'll
          automatically lock itself on the first run.  If the env var
          $FLOCKER is not set to the shell script that is being run,
          then execute flock and grab an exclusive non-blocking lock
          (using the script itself as the lock file) before re-execing
          itself with the right arguments.  It also sets the FLOCKER env
          var to the right value so it doesn't run again.

関連情報