「Borg backup」の版間の差分

提供: ArchWiki
ナビゲーションに移動 検索に移動
(英語版から転載)
 
 
(同じ利用者による、間の13版が非表示)
1行目: 1行目:
 
[[Category:システム管理]]
 
[[Category:システム管理]]
 
[[Category:バックアップ]]
 
[[Category:バックアップ]]
[[en:Borg_backup
+
[[en:Borg_backup]]
 
[[fr:Borg_backup]]
 
[[fr:Borg_backup]]
 
{{Related articles start}}
 
{{Related articles start}}
7行目: 7行目:
 
{{Related|同期およびバックアッププログラム}}
 
{{Related|同期およびバックアッププログラム}}
 
{{Related articles end}}
 
{{Related articles end}}
  +
[https://www.borgbackup.org/ BorgBackup] (略して Borg) は重複排除バックアッププログラムです。オプションで、圧縮と認証済み暗号化をサポートします。
   
  +
Borg の主な目標は、データをバックアップするための効率的かつ安全な方法を提供することです。使用されるデータ重複排除技術により、変更のみが保存されるため、Borg は毎日のバックアップに適しています。認証された暗号化技術により、完全に信頼されていないターゲットへのバックアップにも適しています。
[https://www.borgbackup.org/ BorgBackup] (short: Borg) is a deduplicating backup program. Optionally, it supports compression and authenticated encryption.
 
   
  +
== インストール ==
The main goal of Borg is to provide an efficient and secure way to backup data. The data deduplication technique used makes Borg suitable for daily backups since only changes are stored. The authenticated encryption technique makes it suitable for backups to not fully trusted targets.
 
   
  +
{{Pkg|borg}} パッケージを [[インストール]] して下さい、 開発版は {{AUR|borg-git}} で利用できます。
== Installation ==
 
   
  +
追加機能については、次のパッケージをインストールします。
[[Install]] the {{Pkg|borg}} package. The development version is available with {{AUR|borg-git}}.
 
   
  +
; {{Pkg|python-llfuse}}: アーカイブのマウント用
For additional features, install the following packages:
 
  +
; {{Pkg|openssh}}: リモートホストへの接続用
  +
; {{Pkg|borgmatic}}: ターミナルコマンドの代わりに YAML ファイルを介して Borg を制御する一連のラッパースクリプトのセット ([[borgmatic]], ([https://torsion.org/borgmatic/ ウェブサイト])
  +
; {{AUR|borgctl}}: bash スクリプトを使用しない borgbackup - borgmatic に似ていますが、機能セットがわずかに異なります ([https://github.com/kmille/borgctl borgctl])
  +
; {{AUR|pika-backup}}: Borg 用の libadwaita/GTK4 ベースの GUI
  +
; {{AUR|vorta}}: Borg 用の Qt ベースの GUI
  +
; {{AUR|borgtui-git}}: スケジュールバックアップを行うための TUI と CLI
   
  +
== ドキュメント ==
; {{Pkg|python-llfuse}}: for mounting archives
 
; {{Pkg|openssh}}: for connecting to remote hosts
 
; {{Pkg|borgmatic}}: a set of wrapper scripts to control Borg via YAML files instead of terminal commands
 
; {{AUR|pika-backup}}: a libadwaita/GTK4 based GUI for Borg
 
; {{AUR|vorta}}: a Qt-based GUI for Borg
 
   
  +
公式 [https://borgbackup.readthedocs.io/en/stable/index.html ドキュメント] に [https://borgbackup.readthedocs.io/en/stable/quickstart.html#a-step-by-step-example サンプルクイックスタートガイド] があります、ローカルドキュメントは {{man|1|borg}} と {{ic|apropos borg}} にあります。
== Documentation ==
 
   
  +
さらに、一般的に次のいずれかのコマンドを使用してガイダンスを見つけることができます。
The official [https://borgbackup.readthedocs.io/en/stable/index.html documentation] includes a [https://borgbackup.readthedocs.io/en/stable/quickstart.html#a-step-by-step-example quickstart guide]. Local documentation can be found in {{man|1|borg}} and {{ic|apropos borg}}.
 
 
Additionally, guidance can be found through the command, either generally:
 
   
 
$ borg help
 
$ borg help
   
  +
または特定のコマンドの場合:
or for specific commands:
 
   
 
$ borg help ''command''
 
$ borg help ''command''
   
== Usage ==
+
== 使用方法 ==
   
  +
Borg の背後にある主な概念は '''重複排除''' です。従来の TAR アーカイブのようにファイルを蓄積するのではなく、重複排除ではファイルの名前に関係なく、一度だけコピーされるようにファイルをハッシュすることで、ファイルのアイデンティティを検証します。これは、圧縮を行わなくても、増分バックアップを繰り返すために必要なスペースが最小限であることを意味します。
The main concept behind Borg is '''de-duplication''': rather than accumulating files as in traditional TAR archiving, de-duplication verifies the identity of files, regardless of their names, by hashing them so that they are only copied once. This means that even without compression, it takes up minimal space for repeated incremental backups.
 
   
  +
ファイル圧縮はオプションで、複数のアルゴリズム (zstd を推奨) と圧縮率をサポートします。
File compression is optional and supports multiple algorithms (zstd is recommended) and intensities.
 
   
  +
Borg で作成されたアーカイブは、個々のファイルを参照および復元するために FUSE ファイルシステムとしてマウントできます。
Archives created with Borg can be mounted as FUSE filesystems for browsing and restoring individual files.
 
   
  +
アーカイブは、[[SSHFS]]、[[NFS]]、[[Samba]]、または同様のマウントソリューションを使用して、ローカルまたはリモートシステム上に作成できます。[[OpenSSH|SSH]] 経由の転送はサポートされていますが、リモートホストで Borg が利用可能である必要があります。
Archives can be created locally, or on remote systems using [[SSHFS]], [[NFS]], [[Samba]], or similar mounting solutions. Transfer over [[OpenSSH|SSH]] is supported, but the remote host must have Borg available.
 
   
=== Creating repositories ===
+
=== リポジトリの作成 ===
   
Borg repositories can be encrypted or made tamper-evident. For more information on modes and options, consult the [https://borgbackup.readthedocs.io/en/stable/usage/init.html?highlight=repokey official documentation on setting up a repository].
+
Borg リポジトリは、暗号化したり、改ざんを明示したりすることもできます。モードとオプションの詳細については、[https://borgbackup.readthedocs.io/en/stable/usage/init.html?highlight=repokey リポジトリのセットアップに関する公式ドキュメント] を参照してください。
   
  +
暗号化または認証なしで Borg リポジトリを作成するには:
To create a Borg repository without encryption or authentication:
 
   
 
$ borg init --encryption=none ''/path/to/repo''
 
$ borg init --encryption=none ''/path/to/repo''
   
=== Creating archives ===
+
=== アーカイブの作成 ===
   
  +
{{ic|borg create}} コマンドを使用して、個々のアーカイブ インスタンスをリポジトリ内に作成できます。各アーカイブには一意の名前を付ける必要があります。Borg には [https://borgbackup.readthedocs.io/en/stable/usage/help.html#borg-placeholders プレースホルダーのリスト] が含まれており、日付、時刻、ユーザー名、ホスト名などの文字列を簡単に追加できます。
Individual archive instances can be created within the repository with the {{ic|borg create}} command. Each archive must be given a unique name. Borg includes [https://borgbackup.readthedocs.io/en/stable/usage/help.html#borg-placeholders a list of placeholders] to make adding strings such at dates, times, usernames, and hostnames easier.
 
   
  +
ソースマシンのホスト名と現在の日付を使用して {{ic|archivable-dir}} ディレクトリのアーカイブを作成するには:
To create an archive of the {{ic|archivable-dir}} directory with the hostname of the source machine and the current date:
 
   
 
$ borg create ''/path/to/repo''::{hostname}-{now:%Y-%m-%d} archivable-dir
 
$ borg create ''/path/to/repo''::{hostname}-{now:%Y-%m-%d} archivable-dir
   
  +
Borg は、広範な包含および除外オプションをサポートしています。{{ic|.py}} ファイルをアーカイブから除外するには:
Borg supports extensive inclusion and exclusion options. To exclude {{ic|.py}} files from the archive:
 
   
 
$ borg create ''...'' --exclude '*.pyc' ''/path/to/repo''::''archive-name''
 
$ borg create ''...'' --exclude '*.pyc' ''/path/to/repo''::''archive-name''
   
More information can be found on the {{ic|borg create}} [https://borgbackup.readthedocs.io/en/stable/usage/create.html documentation page].
+
詳細については、{{ic|borg create}} [https://borgbackup.readthedocs.io/en/stable/usage/create.html ドキュメントページ] を参照してください。
   
  +
=== アーカイブのプルーニング ===
=== Pruning archives ===
 
   
  +
古いアーカイブの削除は自動的には実行されませんが、{{ic|borg prune}} コマンドを使用して手動で実行できます。保持するアーカイブの数を指定する必要があり、アーカイブが作成された時間によって制限できます。
The removal of old archives is not performed automatically, but can be performed manually with the {{ic|borg prune}} command. The number of archives to keep must be specified, and can be limited by the time the archive was created.
 
   
  +
過去7日分のアーカイブ、最新の4つの週次アーカイブ、および最新の3つの月次アーカイブのみを保持するには、次のようにします。
To keep only the last 7 daily archives, the last four weekly archives, and the last three monthly archives:
 
   
 
$ borg prune --keep-daily=7 --keep-weekly=4 --keep-monthly=3 ''/path/to/repo''
 
$ borg prune --keep-daily=7 --keep-weekly=4 --keep-monthly=3 ''/path/to/repo''
   
  +
アーカイブの作成時期に関係なく、最新の10個のアーカイブのみを保持するには:
To keep only the last 10 archives, regardless of when they were created:
 
   
 
$ borg prune --keep-last=10 ''/path/to/repo''
 
$ borg prune --keep-last=10 ''/path/to/repo''
   
  +
含まれるアーカイブの数に関係なく、過去30日間のすべてのアーカイブを保持するには:
To keep all archives from the past 30 days, regardless of how many archives that includes:
 
   
 
$ borg prune --keep-within=30d ''/path/to/repo''
 
$ borg prune --keep-within=30d ''/path/to/repo''
   
  +
{{Note|プルーニングはアーカイブを削除しますが、実際にはリポジトリのスペースを解放しません。スペースを解放するには、リポジトリで {{ic|borg compact}} コマンドを使用します。}}
{{Note|Pruning will delete the archives but will not actually free space in the repository. To free space, use the {{ic|borg compact}} command on the repository.}}
 
  +
{{Warning|プルーニングは、{{ic|--prefix}} または {{ic|--glob-archives}} フラグで制限されていない限り、リポジトリ内の ''すべて'' のアーカイブに対して実行されます。}}
{{Warning|Pruning is performed on '''all''' archives in the repository unless restricted by the {{ic|--prefix}} or {{ic|--glob-archives}} flags.}}
 
   
More information can be found on the {{ic|borg prune}} [https://borgbackup.readthedocs.io/en/stable/usage/prune.html documentation page].
+
詳細については、{{ic|borg prune}} [https://borgbackup.readthedocs.io/en/stable/usage/prune.html ドキュメントページ] を参照してください。
   
=== Restoring from an archive ===
+
=== アーカイブからの復元 ===
   
  +
アーカイブから復元するには:
To restore from an archive:
 
   
 
$ borg extract ''/path/to/repo''::''archive-name'' ''path/to/restore''
 
$ borg extract ''/path/to/repo''::''archive-name'' ''path/to/restore''
   
{{Note|Borg will extract the ''full path'' relative to the current working directory. This means that restoring the path {{ic|/home/archuser/path/to/restore}} from an archive while in the archuser's home directory will result in the full restored path being {{ic|/home/archuser/home/archuser/path/to/restore}}}}.
+
{{Note|Borg は、現在の作業ディレクトリからの相対的な ''フルパス'' を抽出します。つまり、アーカイブからユーザのホームディレクトリにあるパス {{ic|/home/archuser/path/to/restore}} をリストアすると、フルリストアのパスは {{ic|/home/archuser/home/archuser/path/to/restore}} になります。}}
   
  +
または、インタラクティブな復元のためにリポジトリをマウントすることもできます。
Alternatively, a repository can be mounted for interactive restoration:
 
   
 
$ borg mount ''/path/to/repo''::''archive-name''
 
$ borg mount ''/path/to/repo''::''archive-name''
   
  +
== ヒントとテクニック ==
== Tips and tricks ==
 
   
=== Cache exclusion ===
+
=== キャッシュの除外 ===
   
Archives' size can be reduced by excluding cache directories. Directories that adhere to the [http://fileformats.archiveteam.org/wiki/Cache_Directory_Tagging_Standard Cache Directory Archiving Standard] can be automatically excluded by appending {{ic|--exclude-caches}} to the archive creation command:
+
アーカイブのサイズは、キャッシュディレクトリを除外することで削減できます。[http://fileformats.archiveteam.org/wiki/Cache_Directory_Tagging_Standard キャッシュディレクトリ アーカイブ標準] に準拠するディレクトリは、アーカイブ作成コマンドに {{ic|--exclude-caches}} を追加することで自動的に除外できます。
   
 
$ borg create ''...'' --exclude-caches ''/path/to/repo''::''archive-name''
 
$ borg create ''...'' --exclude-caches ''/path/to/repo''::''archive-name''
   
  +
=== 影響を受けるファイルの一覧表示 ===
=== Listing affected files ===
 
   
  +
Borg の多くの操作は、影響を受けるファイルまたはアーカイブを一覧表示する {{ic|--list}} フラグをサポートしています。{{ic|--dry-run}} と組み合わせると、ユーザーは特定のコマンドの効果を確認できます。
Many operations in Borg support the {{ic|--list}} flag to list affected files or archives. If paired with {{ic|--dry-run}}, the user can verify the effects of a given command.
 
   
== See also ==
+
== 参照 ==
   
* [https://borgbackup.readthedocs.io/en/stable/ Official documentation]
+
* [https://borgbackup.readthedocs.io/en/stable/ オフィシャルドキュメント]

2024年3月20日 (水) 14:04時点における最新版

関連記事

BorgBackup (略して Borg) は重複排除バックアッププログラムです。オプションで、圧縮と認証済み暗号化をサポートします。

Borg の主な目標は、データをバックアップするための効率的かつ安全な方法を提供することです。使用されるデータ重複排除技術により、変更のみが保存されるため、Borg は毎日のバックアップに適しています。認証された暗号化技術により、完全に信頼されていないターゲットへのバックアップにも適しています。

インストール

borg パッケージを インストール して下さい、 開発版は borg-gitAUR で利用できます。

追加機能については、次のパッケージをインストールします。

python-llfuse
アーカイブのマウント用
openssh
リモートホストへの接続用
borgmatic
ターミナルコマンドの代わりに YAML ファイルを介して Borg を制御する一連のラッパースクリプトのセット (borgmatic, (ウェブサイト)
borgctlAUR
bash スクリプトを使用しない borgbackup - borgmatic に似ていますが、機能セットがわずかに異なります (borgctl)
pika-backupAUR
Borg 用の libadwaita/GTK4 ベースの GUI
vortaAUR
Borg 用の Qt ベースの GUI
borgtui-gitAUR
スケジュールバックアップを行うための TUI と CLI

ドキュメント

公式 ドキュメントサンプルクイックスタートガイド があります、ローカルドキュメントは borg(1)apropos borg にあります。

さらに、一般的に次のいずれかのコマンドを使用してガイダンスを見つけることができます。

$ borg help

または特定のコマンドの場合:

$ borg help command

使用方法

Borg の背後にある主な概念は 重複排除 です。従来の TAR アーカイブのようにファイルを蓄積するのではなく、重複排除ではファイルの名前に関係なく、一度だけコピーされるようにファイルをハッシュすることで、ファイルのアイデンティティを検証します。これは、圧縮を行わなくても、増分バックアップを繰り返すために必要なスペースが最小限であることを意味します。

ファイル圧縮はオプションで、複数のアルゴリズム (zstd を推奨) と圧縮率をサポートします。

Borg で作成されたアーカイブは、個々のファイルを参照および復元するために FUSE ファイルシステムとしてマウントできます。

アーカイブは、SSHFSNFSSamba、または同様のマウントソリューションを使用して、ローカルまたはリモートシステム上に作成できます。SSH 経由の転送はサポートされていますが、リモートホストで Borg が利用可能である必要があります。

リポジトリの作成

Borg リポジトリは、暗号化したり、改ざんを明示したりすることもできます。モードとオプションの詳細については、リポジトリのセットアップに関する公式ドキュメント を参照してください。

暗号化または認証なしで Borg リポジトリを作成するには:

$ borg init --encryption=none /path/to/repo

アーカイブの作成

borg create コマンドを使用して、個々のアーカイブ インスタンスをリポジトリ内に作成できます。各アーカイブには一意の名前を付ける必要があります。Borg には プレースホルダーのリスト が含まれており、日付、時刻、ユーザー名、ホスト名などの文字列を簡単に追加できます。

ソースマシンのホスト名と現在の日付を使用して archivable-dir ディレクトリのアーカイブを作成するには:

$ borg create /path/to/repo::{hostname}-{now:%Y-%m-%d} archivable-dir

Borg は、広範な包含および除外オプションをサポートしています。.py ファイルをアーカイブから除外するには:

$ borg create ... --exclude '*.pyc' /path/to/repo::archive-name

詳細については、borg create ドキュメントページ を参照してください。

アーカイブのプルーニング

古いアーカイブの削除は自動的には実行されませんが、borg prune コマンドを使用して手動で実行できます。保持するアーカイブの数を指定する必要があり、アーカイブが作成された時間によって制限できます。

過去7日分のアーカイブ、最新の4つの週次アーカイブ、および最新の3つの月次アーカイブのみを保持するには、次のようにします。

$ borg prune --keep-daily=7 --keep-weekly=4 --keep-monthly=3 /path/to/repo

アーカイブの作成時期に関係なく、最新の10個のアーカイブのみを保持するには:

$ borg prune --keep-last=10 /path/to/repo

含まれるアーカイブの数に関係なく、過去30日間のすべてのアーカイブを保持するには:

$ borg prune --keep-within=30d /path/to/repo
ノート: プルーニングはアーカイブを削除しますが、実際にはリポジトリのスペースを解放しません。スペースを解放するには、リポジトリで borg compact コマンドを使用します。
警告: プルーニングは、--prefix または --glob-archives フラグで制限されていない限り、リポジトリ内の すべて のアーカイブに対して実行されます。

詳細については、borg prune ドキュメントページ を参照してください。

アーカイブからの復元

アーカイブから復元するには:

$ borg extract /path/to/repo::archive-name path/to/restore
ノート: Borg は、現在の作業ディレクトリからの相対的な フルパス を抽出します。つまり、アーカイブからユーザのホームディレクトリにあるパス /home/archuser/path/to/restore をリストアすると、フルリストアのパスは /home/archuser/home/archuser/path/to/restore になります。

または、インタラクティブな復元のためにリポジトリをマウントすることもできます。

$ borg mount /path/to/repo::archive-name

ヒントとテクニック

キャッシュの除外

アーカイブのサイズは、キャッシュディレクトリを除外することで削減できます。キャッシュディレクトリ アーカイブ標準 に準拠するディレクトリは、アーカイブ作成コマンドに --exclude-caches を追加することで自動的に除外できます。

$ borg create ... --exclude-caches /path/to/repo::archive-name

影響を受けるファイルの一覧表示

Borg の多くの操作は、影響を受けるファイルまたはアーカイブを一覧表示する --list フラグをサポートしています。--dry-run と組み合わせると、ユーザーは特定のコマンドの効果を確認できます。

参照