「ゴミの管理」の版間の差分

提供: ArchWiki
ナビゲーションに移動 検索に移動
(一部翻訳)
(→‎ゴミの作成: 情報を更新)
 
(2人の利用者による、間の7版が非表示)
1行目: 1行目:
 
[[Category:ソフトウェア一覧]]
 
[[Category:ソフトウェア一覧]]
 
[[en:Trash management]]
 
[[en:Trash management]]
ファイルの誤った削除を防ぐために、ごみ箱を使用できます。複数のアプリケーション間の互換性を確保するために、[https://specifications.freedesktop.org/trash-spec/trashspec-latest.html FreeDesktop.org の Trash 仕様] に従うソフトウェア (CLI、GUI、またはライブラリ) を使用できます。
+
ファイルの誤った削除を防ぐために、ゴミ箱を使用できます。複数のアプリケーション間の互換性を確保するために、[https://specifications.freedesktop.org/trash-spec/trashspec-latest.html FreeDesktop.org の Trash 仕様] に従うソフトウェア (CLI、GUI、またはライブラリ) を使用できます。
   
 
{{Note| 一部のアプリケーションは、ファイルシステムごとにゴミ箱を使用できます (仕様を参照してください)}}
 
{{Note| 一部のアプリケーションは、ファイルシステムごとにゴミ箱を使用できます (仕様を参照してください)}}
{{Warning| 別のファイルシステム上のファイルを削除する場合、ごみ箱を使用すると、ファイルがファイルシステム間で転送されるため、遅延が発生する可能性があります。この場合、ファイルシステムごとにごみ箱フォルダーを作成して使用することをお勧めします (仕様の {{ic|Trash directories}} を参照してください)}}
+
{{Warning| 別のファイルシステム上のファイルを削除する場合、ゴミ箱を使用すると、ファイルがファイルシステム間で転送されるため、遅延が発生する可能性があります。この場合、ファイルシステムごとにゴミ箱フォルダーを作成して使用することをお勧めします (仕様の {{ic|Trash directories}} を参照してください)}}
   
== ゴミの作成 ==
+
== ゴミの作成 ==
   
  +
GNOME Files や Dolphin などの一部の GUI ファイルマネージャーは、ゴミ箱へのファイルの移動をネイティブにサポートしています。CLI ツールもいくつかあります。
* {{Pkg|glib2}} ファイルをごみ箱に移動する {{ic|gio Trash ''file...''}} コマンドを提供し、{{ic|gio Trash --empty}} はごみ箱を空にします。{{man|1|gio|COMMANDS}} の "ゴミ箱" も参照してください。{{Pkg|gvfs}} パッケージは、{{ic|gio Trash}} コマンドによるゴミ管理を完全にサポートするために必要です。
 
  +
* {{Pkg|kde-cli-tools}} {{ic|kioclient5}} コマンドを提供します。これは、{{ic|kioclient5 move ''file'' Trash:/}} として使用して {{ic|''file''}} をごみ箱に移動できます。
 
  +
* {{Pkg|glib2}} ファイルをゴミ箱に移動する {{ic|gio trash ''file...''}} コマンドを提供し、{{ic|gio trash --empty}} はゴミ箱を空にします。{{man|1|gio|COMMANDS}} の "trash" も参照してください。{{ic|giotrash}} コマンドによるゴミ箱管理を完全にサポートするには、{{ic|gvfs}} パッケージが必要です。
* {{App|bashtrash|Bash で実装された Freedesktop 準拠のゴミ箱 |https://github.com/robrwo/bashtrash/blob/master/trash|{{AUR|bashtrash}}}}
 
  +
* {{Pkg|kde-cli-tools}} {{ic|kioclient5}} コマンドを提供します。これは、{{ic|kioclient5 move ''file'' Trash:/}} として使用して {{ic|''file''}} をゴミ箱に移動できます。
* {{App|shellDel|シェルスクリプトで実装された Freedesktop 準拠のゴミ箱 |https://github.com/Jorengarenar/shellDel|{{AUR|shelldel}}}}
 
  +
* {{App|bashtrash|Bash で実装された Freedesktop 準拠のゴミ箱|https://github.com/robrwo/bashtrash/blob/master/trash|{{AUR|bashtrash}}}}
  +
* {{App|shellDel|シェルスクリプトで実装された Freedesktop 準拠のゴミ箱|https://github.com/Jorengarenar/shellDel|{{AUR|shelldel}}}}
 
* {{App|trash-cli|[https://specifications.freedesktop.org/trash-spec/trashspec-latest.html FreeDesktop.org の Trash 仕様] を実装するコマンドラインインターフェイスツール|https://github.com/andreafrancia/trash-cli|{{pkg|trash-cli}}}}
 
* {{App|trash-cli|[https://specifications.freedesktop.org/trash-spec/trashspec-latest.html FreeDesktop.org の Trash 仕様] を実装するコマンドラインインターフェイスツール|https://github.com/andreafrancia/trash-cli|{{pkg|trash-cli}}}}
 
* {{App|trashman|Python のゴミ箱マネージャー |https://github.com/Kwpolska/trashman|{{AUR|trashman}}}}
 
* {{App|trashman|Python のゴミ箱マネージャー |https://github.com/Kwpolska/trashman|{{AUR|trashman}}}}
17行目: 19行目:
 
* {{App|trash-d|D で書かれた、GNU rm の Drop-in 置換。互換性とはるかに優れたパフォーマンスに焦点を当てています。|https://github.com/rushsteve1/trash-d|{{AUR|trash-d}}}}
 
* {{App|trash-d|D で書かれた、GNU rm の Drop-in 置換。互換性とはるかに優れたパフォーマンスに焦点を当てています。|https://github.com/rushsteve1/trash-d|{{AUR|trash-d}}}}
   
  +
== ゴミ箱の使用量管理 ==
== Trash space usage management ==
 
 
To prevent the trash can from using too much space, you can empty it yourself, or have a pruning policy
 
   
  +
ゴミ箱がスペースを使いすぎないようにするには、自分で空にするか、剪定ポリシーを設定します。
=== Software list ===
 
   
  +
=== ソフトウェア一覧 ===
* {{App|autotrash|Tool to automatically purge old trashed files|https://github.com/bneijt/autotrash|{{AUR|autotrash}}}}
 
   
  +
* {{App|autotrash|古いゴミ箱のファイルを自動的に削除するツール|https://github.com/bneijt/autotrash|{{AUR|autotrash}}}}
=== Criteria ===
 
   
  +
=== 基準 ===
{{Expansion|Add table with a list of criteria}}
 
   
  +
* 少なくとも x MB の空き容量があることを確認してください
* make sure to have at least x MB of free space
 
  +
* x 日より古いファイルを削除
* delete files older than x days
 
  +
* 空き容量が x MB 未満の場合にのみ空にします (前の基準と組み合わせると便利です)
* only empty if you have less than x MB of free space (useful in combination of previous criteria)
 
  +
* ゴミ箱の最大サイズ
* maximum trash can size
 
  +
* ファイルサイズ
* file size
 
  +
* ファイルの種類
* file type
 
  +
* 元のパス
* original path
 
   
=== Automation ===
+
=== 自動化 ===
   
  +
ゴミ箱を自動的に空にするには、[[cron]]、[[systemd/タイマー]]、または [[自動起動#ファイルシステムのイベントに関して|inotify]] などを使用できます (inotify を使用すると、新規削除のみゴミ箱の自動化をトリガーすることができます。)
To automate emptying the trash can, you can use [[cron]], [[systemd/Timers]], or [[inotify]] (using inotify, only new deletion would trigger the trash can automation)
 
   
  +
== トラブルシューティング ==
== Troubleshooting ==
 
   
  +
=== ゴミ箱ディレクトリが見つからないか、作成できません ===
=== Unable to find or create trash directory ===
 
   
==== External drives ====
+
==== 外付けドライブ ====
   
  +
{{ic|/etc/fstab}} が正しく設定されていない可能性があります。{{ic|ID}} は、{{ic|$ id}} によって自分のユーザー ID に置き換える必要があることに注意してください。
{{ic|/etc/fstab}} might not be set correctly. Note that {{ic|ID}} must be replaced by your own user id by {{ic|$ id}}.
 
   
 
{{hc|/etc/fstab|2=
 
{{hc|/etc/fstab|2=
54行目: 54行目:
 
}}
 
}}
   
  +
ドライブのルートディレクトリに {{ic|~/.Trash-1000/{expunged,files,info}}} が含まれていることを確認し、ディレクトリとサブディレクトリに関連する読み取りアクセスを許可に設定します。
Make sure that the root directory of the drive contains {{ic|~/.Trash-1000/{expunged,files,info}}} and set relevant read permissions for the directory and sub-directory.
 

2023年11月24日 (金) 20:52時点における最新版

ファイルの誤った削除を防ぐために、ゴミ箱を使用できます。複数のアプリケーション間の互換性を確保するために、FreeDesktop.org の Trash 仕様 に従うソフトウェア (CLI、GUI、またはライブラリ) を使用できます。

ノート: 一部のアプリケーションは、ファイルシステムごとにゴミ箱を使用できます (仕様を参照してください)
警告: 別のファイルシステム上のファイルを削除する場合、ゴミ箱を使用すると、ファイルがファイルシステム間で転送されるため、遅延が発生する可能性があります。この場合、ファイルシステムごとにゴミ箱フォルダーを作成して使用することをお勧めします (仕様の Trash directories を参照してください)

ゴミ箱の作成

GNOME Files や Dolphin などの一部の GUI ファイルマネージャーは、ゴミ箱へのファイルの移動をネイティブにサポートしています。CLI ツールもいくつかあります。

  • glib2 ファイルをゴミ箱に移動する gio trash file... コマンドを提供し、gio trash --empty はゴミ箱を空にします。gio(1) § COMMANDS の "trash" も参照してください。giotrash コマンドによるゴミ箱管理を完全にサポートするには、gvfs パッケージが必要です。
  • kde-cli-tools kioclient5 コマンドを提供します。これは、kioclient5 move file Trash:/ として使用して file をゴミ箱に移動できます。
  • bashtrash — Bash で実装された Freedesktop 準拠のゴミ箱
https://github.com/robrwo/bashtrash/blob/master/trash || bashtrashAUR
  • shellDel — シェルスクリプトで実装された Freedesktop 準拠のゴミ箱
https://github.com/Jorengarenar/shellDel || shelldelAUR
https://github.com/andreafrancia/trash-cli || trash-cli
  • trashman — Python のゴミ箱マネージャー
https://github.com/Kwpolska/trashman || trashmanAUR
  • rmtrash — Trash-put が GNU rm および rmdir と互換性を持つようになりました。
https://github.com/PhrozenByte/rmtrash || rmtrashAUR
  • trash-d — D で書かれた、GNU rm の Drop-in 置換。互換性とはるかに優れたパフォーマンスに焦点を当てています。
https://github.com/rushsteve1/trash-d || trash-dAUR

ゴミ箱の使用量管理

ゴミ箱がスペースを使いすぎないようにするには、自分で空にするか、剪定ポリシーを設定します。

ソフトウェア一覧

  • autotrash — 古いゴミ箱のファイルを自動的に削除するツール
https://github.com/bneijt/autotrash || autotrashAUR

基準

  • 少なくとも x MB の空き容量があることを確認してください
  • x 日より古いファイルを削除
  • 空き容量が x MB 未満の場合にのみ空にします (前の基準と組み合わせると便利です)
  • ゴミ箱の最大サイズ
  • ファイルサイズ
  • ファイルの種類
  • 元のパス

自動化

ゴミ箱を自動的に空にするには、cronsystemd/タイマー、または inotify などを使用できます (inotify を使用すると、新規削除のみゴミ箱の自動化をトリガーすることができます。)

トラブルシューティング

ゴミ箱ディレクトリが見つからないか、作成できません

外付けドライブ

/etc/fstab が正しく設定されていない可能性があります。ID は、$ id によって自分のユーザー ID に置き換える必要があることに注意してください。

/etc/fstab
# <device>                                <dir>              <type>    <options>         <dump> <fsck>
UUID=75667752-8b06-11ea-bc55-0242ac130003 /externalDrive     ntfs-3g   defaults,uid=ID   0      1

ドライブのルートディレクトリに ~/.Trash-1000/{expunged,files,info} が含まれていることを確認し、ディレクトリとサブディレクトリに関連する読み取りアクセスを許可に設定します。