General commands

Barmanには多くのコマンドがあり、説明のために、それらをスコープごとに整理できます。

一般的なコマンド の範囲はBarmanサーバー全体であり、多くのPostgreSQLサーバーをバックアップできます。代わりに、 サーバーコマンド は指定されたサーバーでのみ動作します。 バックアップコマンド は、特定のサーバーから取得されたバックアップで機能します。

次のリストには、一般的なコマンドが含まれています。

cron

barman には、長時間実行されるデーモンまたはサービスファイルが含まれていません(systemctl start 、service start などはありません)。代わりに、 barman のバックグラウンド「定常状態」バックアップ操作を実行するbarman cron サブコマンドが提供されています。

cron コマンドを使用して、WALファイルとバックアップの両方でメンテナンス操作を実行できます。

barman cron

注釈

This command should be executed in a cron script. Our recommendation is to schedule barman cron to run every minute. If you installed Barman using the rpm or debian package, a cron entry running on every minute will be created for you.

barman cron はサーバーベースでWALアーカイブ操作を同時に実行します。これにより、次のサーバーにも保持ポリシーが適用されます。

  • retention_policy は空でも有効でもありません。

  • retention_policy_mode をauto に設定。

cron コマンドは、 receive-wal コマンドを透過的に実行することにより、要求したサーバーでWALストリーミングが開始されます。

cron コマンドによって開始された操作を停止するには、cronエントリをコメントアウトして実行します。

barman receive-wal --stop SERVER_NAME

barman list-servers をチェックして、すべてのサーバーを取得できることを確認してください。

注釈

barman cron runs background maintenance tasks only and is not responsible for running scheduled backups. Any regularly scheduled backup jobs you require must be scheduled separately, for example in another cron entry which runs barman backup all .

diagnose

diagnose コマンドは、診断とサポートの目的に役立つJSONレポートを作成します。このレポートには、構成されているすべてのサーバーの情報が含まれています。

重要

Even if the diagnose is written in JSON and that format is thought to be machine readable, its structure is not to be considered part of the interface. Format can change between different Barman versions.

list-servers

バックアップシステム用に構成されたアクティブサーバーのリストを表示できます。

barman list-servers

--minimal オプションを使用して、機械可読出力を取得できます。

barman list-servers --minimal