This is an automated email from the ASF dual-hosted git repository.

sarvekshayr pushed a commit to branch HDDS-9225-website-v2
in repository https://gitbox.apache.org/repos/asf/ozone-site.git


The following commit(s) were added to refs/heads/HDDS-9225-website-v2 by this 
push:
     new 56cae3699 HDDS-14291. [Website v2] [Docs] [Administrator Guide] Trash 
(#182)
56cae3699 is described below

commit 56cae3699dcfa1fdc1cebd765d6357cfaa8109ff
Author: Eric C. Ho <[email protected]>
AuthorDate: Wed Dec 31 18:00:25 2025 +0800

    HDDS-14291. [Website v2] [Docs] [Administrator Guide] Trash (#182)
---
 .../03-operations/12-trash.md                      | 56 ++++++++++++++++++++++
 1 file changed, 56 insertions(+)

diff --git a/docs/05-administrator-guide/03-operations/12-trash.md 
b/docs/05-administrator-guide/03-operations/12-trash.md
new file mode 100644
index 000000000..114ebc14e
--- /dev/null
+++ b/docs/05-administrator-guide/03-operations/12-trash.md
@@ -0,0 +1,56 @@
+---
+sidebar_label: Trash
+---
+
+# Trash
+
+The trash feature in Ozone provides a way to recover files that have been 
accidentally deleted. When enabled, deleted files are moved to a trash 
directory instead of being permanently removed.
+
+## Enabling the Trash Feature
+
+To enable the trash feature, you need to add the following configuration 
properties to the Ozone Manager's `core-site.xml`:
+
+```xml
+<property>
+  <name>fs.trash.interval</name>
+  <value>360</value> <!-- Time in minutes -->
+</property>
+
+<property>
+  <name>fs.trash.classname</name>
+  <value>org.apache.hadoop.fs.ozone.OzoneTrashPolicy</value>
+</property>
+```
+
+The `fs.trash.interval` property specifies the minimum time, in minutes, for 
which a deleted file will be kept in the trash. After this interval, the trash 
emptier will permanently delete the file. A value of 0 disables the trash 
feature.
+
+The `fs.trash.classname` property should be set to 
`org.apache.hadoop.fs.ozone.OzoneTrashPolicy` to use Ozone's trash 
implementation.
+
+## Using the Trash
+
+When the trash feature is enabled, any file deleted using the `ozone fs -rm` 
command will be moved to the trash.
+
+### Trash Location
+
+The trash directory is located at `/<volume>/<bucket>/.Trash/<username>`. For 
example, if the user `testuser` deletes a file from `/vol1/bucket1`, the file 
will be moved to `/vol1/bucket1/.Trash/testuser/Current/`.
+
+### Skipping the Trash
+
+To permanently delete a file and bypass the trash, use the `-skipTrash` option 
with the `rm` command:
+
+```bash
+ozone fs -rm -skipTrash /<volume>/<bucket>/<key>
+```
+
+### Emptying the Trash
+
+The trash emptier is a background process that periodically deletes files from 
the trash directory after the configured `fs.trash.interval` has passed. The 
interval at which the trash emptier runs can be configured with the 
`ozone.fs.trash.checkpoint.interval` property in `ozone-site.xml`.
+
+```xml
+<property>
+  <name>ozone.fs.trash.checkpoint.interval</name>
+  <value>60</value> <!-- Time in minutes -->
+</property>
+```
+
+If this property is not set, it defaults to the value of 
`fs.trash.checkpoint.interval`.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to