|
1 | | -====================== |
2 | | -Managing deleted files |
3 | | -====================== |
| 1 | +============= |
| 2 | +Deleted files |
| 3 | +============= |
4 | 4 |
|
5 | | -When you delete a file in Nextcloud, it is not immediately deleted permanently, |
6 | | -only moved into the trash bin. It is not permanently deleted until you manually |
7 | | -delete it, or when the Deleted Files app deletes it to make room for new files. |
| 5 | +When you delete a file or folder in Nextcloud, it is normally moved to the |
| 6 | +trash bin instead of being deleted immediately. This allows you to restore it |
| 7 | +later. |
8 | 8 |
|
9 | | -Find your deleted files by clicking the **Deleted files** button on the Files |
10 | | -page of the Nextcloud web interface. You can restore or permanently delete files from there. |
| 9 | +Items in the trash bin are permanently deleted when one of the following |
| 10 | +occurs: |
| 11 | + |
| 12 | +- You manually select *Delete permanently*. |
| 13 | +- The Deleted Files app removes the item according to the configured retention |
| 14 | + policy. |
| 15 | +- The effective trash-bin size limit is exceeded and the item is eligible for |
| 16 | + removal to free space. |
| 17 | + |
| 18 | +Find your deleted files by selecting **Deleted files** in the Files area of the |
| 19 | +Nextcloud Web interface. From there, you can restore items, download them to |
| 20 | +your device, or delete them permanently. |
| 21 | + |
| 22 | +When you restore an item, Nextcloud normally attempts to return it to its |
| 23 | +original location. If that location no longer exists or is not writable, the |
| 24 | +item is restored to the root of your Files area. If an item with the same name |
| 25 | +already exists, Nextcloud gives the restored item a unique name. |
| 26 | + |
| 27 | +.. note:: If the Versions app is enabled, versions associated with a deleted |
| 28 | + file are moved to the trash bin and are restored when the file is restored. |
11 | 29 |
|
12 | 30 | Quotas |
13 | 31 | ------ |
14 | 32 |
|
15 | | -Deleted files are not counted against your storage quota. Only your personal |
16 | | -files count against your quota, not files which were shared with you. |
17 | | -(See :doc:`quota` to learn more about quotas.) |
| 33 | +Files and folders in your trash bin do not count against your normal storage |
| 34 | +quota. |
| 35 | + |
| 36 | +See :doc:`quota` for more information about how storage quotas are calculated. |
18 | 37 |
|
19 | 38 | What happens when shared files are deleted |
20 | 39 | ------------------------------------------ |
21 | 40 |
|
22 | | -Deleting files gets a little complicated when they are shared files, as this |
23 | | -scenario illustrates: |
24 | | - |
25 | | -1. User1 shares a folder "test" with User2 and User3 |
26 | | -2. User2 (the recipient) deletes a file/folder "sub" inside of "test" |
27 | | -3. The folder "sub" will be moved to the trash bin of both User1 (owner) and |
28 | | - User2 (recipient) |
29 | | -4. But User3 will not have a copy of "sub" in their trash bin |
30 | | - |
31 | | -When User1 deletes "sub" then it is moved to User1's trash bin. It is |
32 | | -deleted from User2 and User3, but not placed in their trash bins. |
33 | | - |
34 | | -When you share files, other users may copy, rename, move, and share them with |
35 | | -other people, just as they can for any computer files; Nextcloud does not have |
36 | | -magic powers to prevent this. |
37 | | - |
38 | | -How the deleted files app manages storage space |
39 | | ------------------------------------------------ |
40 | | - |
41 | | -To ensure that users do not run over their storage quotas, the Deleted Files |
42 | | -app allocates a maximum of 50% of their currently available free space to |
43 | | -deleted files. If your deleted files exceed this limit, Nextcloud deletes the |
44 | | -oldest files (files with the oldest timestamps from when they were deleted) |
45 | | -until it meets the memory usage limit again. |
46 | | - |
47 | | -Nextcloud checks the age of deleted files every time new files are added to the |
48 | | -deleted files. By default, deleted files stay in the trash bin for 30 days. The |
49 | | -Nextcloud server administrator can adjust this value in the ``config.php`` file |
50 | | -by setting the ``trashbin_retention_obligation`` value. Files older than the |
51 | | -``trashbin_retention_obligation`` value will be deleted permanently. |
52 | | -Additionally, Nextcloud calculates the maximum available space every time a new |
53 | | -file is added. If the deleted files exceed the new maximum allowed space |
54 | | -Nextcloud will permanently delete those trashed files with the soonest expiration |
55 | | -until the space limit is met again. |
56 | | - |
57 | | -.. note:: Your administrator may have configured the trash bin retention period |
58 | | - to override the storage space management. See `admin documentation <https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/config_sample_php_parameters.html#deleted-items-trash-bin>`_ for more details. |
| 41 | +The behavior of deleted shared files depends on who deletes the item and who |
| 42 | +owns it. |
| 43 | + |
| 44 | +For example, User1 shares a folder named ``TheProject/`` with User2 and User3: |
| 45 | + |
| 46 | +1. User2, a share recipient (sharee), deletes a folder or file named |
| 47 | + ``Phase2`` inside ``TheProject/``. |
| 48 | + |
| 49 | + ``TheProject/Phase2`` is moved to the trash bin of User1, the owner, and a |
| 50 | + copy is placed in User2's trash bin when possible. The item is removed from |
| 51 | + the shared folder for User3, but User3 does not receive a copy in their |
| 52 | + trash bin. |
| 53 | + |
| 54 | +2. User1, the owner, deletes ``TheProject/Phase2``. |
| 55 | + |
| 56 | + The item is moved to User1's trash bin and removed from the shared folder for |
| 57 | + User2 and User3. It is not placed in their trash bins. |
| 58 | + |
| 59 | +The exact behavior can depend on the type of share and the permissions granted |
| 60 | +by the share. Depending on those permissions, other users may be able to copy, |
| 61 | +rename, move, or re-share shared files. These operations can affect which |
| 62 | +account owns the resulting files and which trash bin receives a deleted item. |
| 63 | + |
| 64 | +.. note:: |
| 65 | + |
| 66 | + When a sharee deletes an item owned by another user, Nextcloud moves the item |
| 67 | + to the owner's trash bin. A copy in the deleting user's trash bin is also |
| 68 | + created (in most cases; the copy is on a best-effort basis and is not |
| 69 | + guaranteed). |
| 70 | + |
| 71 | +How the Deleted Files app manages storage space |
| 72 | +------------------------------------------------ |
| 73 | + |
| 74 | +The Deleted Files app manages trash-bin contents using two related rules: |
| 75 | + |
| 76 | +- A storage limit determines how much space the trash bin may use. |
| 77 | +- A retention policy determines when deleted items become eligible for |
| 78 | + permanent deletion. |
| 79 | + |
| 80 | +Trash-bin storage limit |
| 81 | +~~~~~~~~~~~~~~~~~~~~~~~ |
| 82 | + |
| 83 | +For accounts with a storage quota, the default trash-bin limit is up to 50% of |
| 84 | +the account's remaining quota space. This is calculated after the account's |
| 85 | +active files have been taken into account; it is not 50% of the account's total |
| 86 | +quota. |
| 87 | + |
| 88 | +For example, if your quota is 10 GB and your active files use 8 GB, the default |
| 89 | +trash-bin allowance is calculated from the remaining 2 GB. |
| 90 | + |
| 91 | +For accounts without a storage quota, the default limit is calculated using |
| 92 | +available filesystem space instead. Your administrator can override either |
| 93 | +default by configuring a global or per-account trash-bin size. |
| 94 | + |
| 95 | +When the effective trash-bin limit is exceeded, Nextcloud removes eligible |
| 96 | +deleted items, starting with the oldest items, until the limit is satisfied |
| 97 | +again. |
| 98 | + |
| 99 | +Retention and permanent deletion |
| 100 | +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 101 | + |
| 102 | +By default, deleted files are retained for at least 30 days. After that, |
| 103 | +eligible items may be permanently deleted when space is needed; they are not |
| 104 | +necessarily deleted immediately after 30 days. |
| 105 | + |
| 106 | +Your administrator can configure different minimum and maximum retention |
| 107 | +periods. Depending on the configuration, items may be permanently deleted |
| 108 | +after a maximum age even when storage space is not currently needed. Automatic |
| 109 | +expiration can also be disabled. |
| 110 | + |
| 111 | +For policies with a configured minimum retention period, an item is eligible |
| 112 | +for space-based cleanup only after that period has elapsed. Policies without a |
| 113 | +minimum retention period may allow space-based cleanup regardless of the |
| 114 | +item's age. Items that have exceeded a configured maximum retention period can |
| 115 | +be permanently deleted regardless of whether space is currently needed. |
| 116 | + |
| 117 | +The relevant configuration setting is |
| 118 | +``trashbin_retention_obligation``. For details about the available values and |
| 119 | +their interaction with quotas and trash-bin sizes, see the |
| 120 | +`Deleted Files section of the Administrator Manual |
| 121 | +<https://docs.nextcloud.com/server/latest/admin_manual/configuration_files/trashbin_configuration.html>`_. |
| 122 | + |
| 123 | +.. note:: |
| 124 | + |
| 125 | + The Deleted Files app may permanently delete an item before its maximum |
| 126 | + retention period when the effective trash-bin limit is exceeded and the |
| 127 | + item's minimum retention period has elapsed. |
0 commit comments