rsyncの解説ってどこ読んでもよく分からないと思います。exclude-fromファイルのフォーマットについても詳細な解説がないのですが、Joho the Blog » Beginner to Beginnerに分かり易く説明されていました。 以下拙訳ですが、参考までに載せておきます。 exclude-from ファイルには include と exclude の両方を記述できる。どちらの記述なのかを + か - で示す。そのリストではrsyncコマンドで指定したパスがルートディレクトリになる。つまり、コマンドラインで"/Users/me/"をバックアップするように書いた場合、exclude-from ファイルで以下の記述をすると、"/Users/me/junk" を exclude することになる。 - junk/ 同じように、"/Users/me/importankstuff/"を
rsyncで特定のファイル、ディレクトリを除外して転送は--excludeオプションを指定すれば、事足りるんだけど、いくつかのディレクトリとかファイルとかだけ転送させたい。なんてことがあったりする。あんまり情報がないので、とりあえず書いとく。 よくあるのだと全てのディレクトリ、ファイル毎日rsyncしつつ、特定のディレクトリはバックアップを取らないみたいのが多いと思う # /backupにごっそりバックアップ。けど特定のディレクトリは除外 rsync -av -H --delete --force --exclude="/backup/" --exclude="/dev/" --exclude="/proc/" --exclude="/sys/" / /backup # とかリモートのサーバにバックアップとか rsync -avz -H --delete --force --exclude
# vi /etc/xinetd.d/rsync -------------------- # default: off # description: The rsync server is a good addition to an ftp server, as it \ # allows crc checksumming etc. service rsync { disable = no ←変更 flags = IPv6 socket_type = stream wait = no user = root server = /usr/bin/rsync server_args = --daemon log_on_failure += USERID } # vi /etc/rsyncd.conf -------------------- #-------------- # Global
Ansibleにおいて操作対象ホスト上でファイルやディレクトリをコピーすることはcopyモジュールではできないが、synchronizeモジュールではできるようになっている。 synchronizeモジュールはrsyncを実行させるモジュールであり、他のモジュールにないちょっと特殊な動きをする。 というのもsynchronizeモジュールは通常、"操作対象ホスト"ではなく"Ansibleの実行ホスト"でrsyncが起動されるのだが、にもかかわらずdelegate_toアトリビュートを指定すれば"Ansibleの実行ホスト"でもなく"delegate_toで指定されたホスト"でrsyncが起動されるようにすることができるのである。 synchronizeモジュールは「rsync起動ホスト」から「操作対象ホスト」へのファイルやディレクトリのコピーを行う。1 つまりdelegate_toを使って
サーバ間で rsync を使ったファイルの同期の課題を与えられた後輩が、あれこれ調べてたどり着いたサイトの内容を後ろから覗き込んだ時、思わず「イケてない。自分ならやらない」と言ってしまったことがありました。セキュリティに気を使って「ssh 経由で rsync」までは良いとして、sshd_config で PermitRootLogin を yes にするのは、個人的には「ありえない」と思いました。 以前に、自分で ssh + rsync を実際に動かした時に、どんな風に考えて、どのような事をやったのか、書いてみます。 同期の方向 rsync で同期する際、マスター側からプッシュするのか、バックアップ側からプルするのか、というがあります。基本的にはどっちでも良いと思いますが、仮にバックアップ側がダウンしている場合に、余分なエラーを発生させたくない、と思い、バックアップ側からプルする事にしまし
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く