# How do I empty the trash?

**URL:** <https://forum.storj.io/t/how-do-i-empty-the-trash/15485>\
**Category:** troubleshooting\
**Tags:** trash\
**Created:** [September 28, 2021, 11:11pm UTC](https://forum.storj.io/t/how-do-i-empty-the-trash/15485 "2021-09-28T23:11:08Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![Roberto](https://storj.bcdn.literatehosting.com/letter_avatar/roberto/32/5_5575768a8748004e209b776fc1b2916d.png) [@Roberto](https://forum.storj.io/u/Roberto)\
**Post date:** [April 29, 2023, 4:38pm UTC](https://forum.storj.io/t/how-do-i-empty-the-trash/15485/21 "2023-04-29T16:38:56Z")

</div>

Thanks arrogantrabbit for the explanation, I guessed

---

<div class="post-metadata">

**Author:** ![mgonzalezm](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/mgonzalezm/32/1125_2.png) [@mgonzalezm](https://forum.storj.io/u/mgonzalezm)\
**Post date:** [April 29, 2023, 4:52pm UTC](https://forum.storj.io/t/how-do-i-empty-the-trash/15485/22 "2023-04-29T16:52:22Z")

</div>

> [@snorkel](#):
>
> is the trash space payed for? By who? By the client? Or just by Storj?

it is NOT payed. Nobody is paying for this.

---

<div class="post-metadata">

**Author:** ![Alexey](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/alexey/32/41_2.png) [@Alexey](https://forum.storj.io/u/Alexey)\
**Post date:** [April 30, 2023, 4:20am UTC](https://forum.storj.io/t/how-do-i-empty-the-trash/15485/23 "2023-04-30T04:20:35Z")

</div>

> [@snorkel](#):
>
> if a client deleted something and wants to retrieve it, it has 7 days to do it

This is not for the client, it’s mostly for SNO to protect from disqualification in case if the satellite would send an incorrect bloom filter and it could remove data which should not be removed.  
We will have 7 days to restore wrongly deleted data and fix an issue.  
If you delete this data, your node could not recover it and will be DQ for losing it.

See also

> [@Is there a plan to reduce Trash holding time?](https://forum.storj.io/t/is-there-a-plan-to-reduce-trash-holding-time/22511/3):
>
> @Toyoo is right. This isn’t for customers. There was already a bug in server side copy that caused a race condition, resulting in bloom filters being sent out that didn’t contain new pieces, making the nodes delete them incorrectly. In scenarios like that, Storj Labs has 7 days to become aware of the issue, identify the pieces that need to be restored and write the code to restore them. 7 days is not a lot of time to do that. I don’t see a way to lower that and not risk data loss in such scenari…

@Roberto please do not remove the trash folder unless you want to disqualify your node.  
All files older than 7 days will be removed automatically.

---

<div class="post-metadata">

**Author:** ![naxbc](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/naxbc/32/1125_2.png) [@naxbc](https://forum.storj.io/u/naxbc)\
**Post date:** [April 27, 2024, 10:13am UTC](https://forum.storj.io/t/how-do-i-empty-the-trash/15485/24 "2024-04-27T10:13:15Z")

</div>

Same on my Windows node.  
There are folders inside with content and last modified date on the folder with content is January 2020!  
Deleting it manually. It´s 759GB.

---

<div class="post-metadata">

**Author:** ![Alexey](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/alexey/32/41_2.png) [@Alexey](https://forum.storj.io/u/Alexey)\
**Post date:** [April 27, 2024, 10:22am UTC](https://forum.storj.io/t/how-do-i-empty-the-trash/15485/25 "2024-04-27T10:22:27Z")

</div>

Please do not delete anything manually! Your node will be at risk of disqualification now on!

Check the actual pieces older than 7 days with these scripts instead:

> [@How long does trash stay before getting deleted?](https://forum.storj.io/t/how-long-does-trash-stay-before-getting-deleted/25662/6):
>
> For bash: For Windows PowerShell:

The Creation date is not the same as an expiration date!

---

<div class="post-metadata">

**Author:** ![naxbc](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/naxbc/32/1125_2.png) [@naxbc](https://forum.storj.io/u/naxbc)\
**Post date:** [April 27, 2024, 12:00pm UTC](https://forum.storj.io/t/how-do-i-empty-the-trash/15485/26 "2024-04-27T12:00:01Z")

</div>

Next steps please my friend? Seems I have quite a bunch:  
 ![image](https://storj-s3.bcdn.literatehosting.net/original/3X/f/a/faac62b6db50da61361affd77b656a11a889eddd.png)  
Lazy filewalker is now disabled.

---

<div class="post-metadata">

**Author:** ![Alexey](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/alexey/32/41_2.png) [@Alexey](https://forum.storj.io/u/Alexey)\
**Post date:** [April 27, 2024, 12:03pm UTC](https://forum.storj.io/t/how-do-i-empty-the-trash/15485/27 "2024-04-27T12:03:31Z")

</div>

What are parameters for the second run? Your photo is cut. Please do not use screenshots for the text, never, I would appreciate that.

---

<div class="post-metadata">

**Author:** ![naxbc](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/naxbc/32/1125_2.png) [@naxbc](https://forum.storj.io/u/naxbc)\
**Post date:** [April 27, 2024, 12:16pm UTC](https://forum.storj.io/t/how-do-i-empty-the-trash/15485/28 "2024-04-27T12:16:09Z")

</div>

Sorry, was unware.  
It´s this command:  
“Get-ChildItem E:\Storage\trash\ -File -Recurse | Where-Object {$_.LastWriteTime -lt (Get-Date).AddDays(-7)} | Measure-Object -Property Length -Sum | %{“Total {0:f2} MB`ncount {1}” -f ($_.Sum/1e6), $\_.Count}”

---

<div class="post-metadata">

**Author:** ![Alexey](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/alexey/32/41_2.png) [@Alexey](https://forum.storj.io/u/Alexey)\
**Post date:** [April 27, 2024, 12:21pm UTC](https://forum.storj.io/t/how-do-i-empty-the-trash/15485/29 "2024-04-27T12:21:38Z")

</div>

The `-7` mean that it should count pieces which must be in the trash at this time.  
The `-8` parameter will show what’s must not be in the trash.  
And I guess this last one returned 0 accordingly your screenshot.

---

<div class="post-metadata">

**Author:** ![naxbc](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/naxbc/32/1125_2.png) [@naxbc](https://forum.storj.io/u/naxbc)\
**Post date:** [April 27, 2024, 8:29pm UTC](https://forum.storj.io/t/how-do-i-empty-the-trash/15485/30 "2024-04-27T20:29:21Z")

</div>

This is the “-8” results:

PS C:\Users\Admin\> Get-ChildItem e:\Storage\trash\ -File -Recurse | Where-Object {$_.LastWriteTime -lt (Get-Date).AddDays(-8)} | Measure-Object -Property Length -Sum | %{“Total {0:f2} MB`ncount {1}” -f ($_.Sum/1e6), $\_.Count} Total 1173726.04 MB  
count 7566064

Which seems to me 1.1TB (roughly) that shoud not be there?

---

<div class="post-metadata">

**Author:** ![vladro](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/vladro/32/1129_2.png) [@vladro](https://forum.storj.io/u/vladro)\
**Post date:** [April 28, 2024, 6:20am UTC](https://forum.storj.io/t/how-do-i-empty-the-trash/15485/31 "2024-04-28T06:20:15Z")

</div>

@Alexey still unclear- what to do with old trash folders like this:  
 ![image](https://storj-s3.bcdn.literatehosting.net/original/3X/1/d/1dbe572dbd4e9cf7822a51b4ea8be65bfc9c4f1a.png)  
they are not empty (for this node more then 300gb+), node restarted several times to initiate filewalker (as u can see- new subfolders were created correctly), latest version is installed  
seems that early folders were created during 99-100 version and not automatically deleted by new versions

---

<div class="post-metadata">

**Author:** ![vladro](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/vladro/32/1129_2.png) [@vladro](https://forum.storj.io/u/vladro)\
**Post date:** [April 28, 2024, 6:25am UTC](https://forum.storj.io/t/how-do-i-empty-the-trash/15485/32 "2024-04-28T06:25:17Z")

</div>

![image](https://storj-s3.bcdn.literatehosting.net/original/3X/a/5/a5a3edb8f2bd81ab322bb5ee6aec76d1b0f0b0ec.png)  
 ![image](https://storj-s3.bcdn.literatehosting.net/original/3X/e/7/e75c4fbf85938eabc5ec6f5751415f711495d88b.png)

![image](https://storj-s3.bcdn.literatehosting.net/original/3X/5/a/5a2f705c60d340988c6c711e24d0ee7d147b9171.png)  
just to show that its happen on several nodes…

---

<div class="post-metadata">

**Author:** ![Alexey](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/alexey/32/41_2.png) [@Alexey](https://forum.storj.io/u/Alexey)\
**Post date:** [April 28, 2024, 7:24am UTC](https://forum.storj.io/t/how-do-i-empty-the-trash/15485/33 "2024-04-28T07:24:51Z")

</div>

Please use the script instead. The folder name doesn’t help here. It’s created when the node moved pieces to the trash, not when they will expire.  
It also depends on the storagenode version, some versions 1.10x.x are aware of a new structure, older versions are not. The current minimum version is 1.99.3  
If you use a docker version, it may rollback to the minimum version if you would recreate the container, so the new one moved pieces to the subfolder, but the old one don’t know it yet, so it will use an old approach, i.e. scan pieces every day.

In short - please use the script.

---

<div class="post-metadata">

**Author:** ![Alexey](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/alexey/32/41_2.png) [@Alexey](https://forum.storj.io/u/Alexey)\
**Post date:** [April 28, 2024, 7:26am UTC](https://forum.storj.io/t/how-do-i-empty-the-trash/15485/34 "2024-04-28T07:26:00Z")

</div>

What’s your current version for this node?

---

<div class="post-metadata">

**Author:** ![naxbc](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/naxbc/32/1125_2.png) [@naxbc](https://forum.storj.io/u/naxbc)\
**Post date:** [April 28, 2024, 4:09pm UTC](https://forum.storj.io/t/how-do-i-empty-the-trash/15485/35 "2024-04-28T16:09:37Z")

</div>

It´s on version 1.102.3

---

<div class="post-metadata">

**Author:** ![vladro](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/vladro/32/1129_2.png) [@vladro](https://forum.storj.io/u/vladro)\
**Post date:** [April 28, 2024, 7:20pm UTC](https://forum.storj.io/t/how-do-i-empty-the-trash/15485/36 "2024-04-28T19:20:07Z")

</div>

my nodes are currently 102.x  
about the script- as I see its only collecting info not fixing anything right? (if yes- I personally suffer from terabytes of trash that is not deleted atm… and have to move them to bigger disk- script it taking a lot of time on bigger trash folders generating I/o preventing to move %(((

---

<div class="post-metadata">

**Author:** ![naxbc](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/naxbc/32/1125_2.png) [@naxbc](https://forum.storj.io/u/naxbc)\
**Post date:** [April 30, 2024, 10:12am UTC](https://forum.storj.io/t/how-do-i-empty-the-trash/15485/37 "2024-04-30T10:12:01Z")

</div>

@Alexey any thoughts on it? It’s on version 1.102.3  
There’s definitely something wrong here…  
Apparently, the older than 8 days files are gone, but for some reason database is not updated.  
Before you ask, yes, I check all the databases and all the return results from the check is “ok”.

![image](https://storj-s3.bcdn.literatehosting.net/original/3X/5/f/5f47366cbbebb12ce2828e07090995c1269fc062.png)

---

<div class="post-metadata">

**Author:** ![vladro](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/vladro/32/1129_2.png) [@vladro](https://forum.storj.io/u/vladro)\
**Post date:** [May 2, 2024, 6:36am UTC](https://forum.storj.io/t/how-do-i-empty-the-trash/15485/38 "2024-05-02T06:36:58Z")

</div>

My champion:  
 ![image](https://storj-s3.bcdn.literatehosting.net/original/3X/c/7/c7cbd582f477d896a467d186924dfd555e8d7990.png)

 ![image](https://storj-s3.bcdn.literatehosting.net/original/3X/5/7/57c5098875a5e183c7fa99a357acd82df050fe70.png)  
 ![image](https://storj-s3.bcdn.literatehosting.net/original/3X/6/4/64bd6037757d80e2d74dc3aba3186a9a3521c3ad.png)  
 ![image](https://storj-s3.bcdn.literatehosting.net/original/3X/8/3/8347cc4d67ea6580569a72ba9478034b7eb0b454.png)  
version 103.1

---

<div class="post-metadata">

**Author:** ![jammerdan](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/jammerdan/32/1121_2.png) [@jammerdan](https://forum.storj.io/u/jammerdan)\
**Post date:** [May 2, 2024, 7:15am UTC](https://forum.storj.io/t/how-do-i-empty-the-trash/15485/39 "2024-05-02T07:15:22Z")

</div>

> [@vladro](#):
>
> My champion:

Looks like it doesn’t delete anything in trash.

But I think you should also run the command on each date folder to check if they hold pieces or not.

---

<div class="post-metadata">

**Author:** ![vladro](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/vladro/32/1129_2.png) [@vladro](https://forum.storj.io/u/vladro)\
**Post date:** [May 2, 2024, 8:28am UTC](https://forum.storj.io/t/how-do-i-empty-the-trash/15485/40 "2024-05-02T08:28:52Z")

</div>

@Alexey should i run it for every folder ? if yes what script 7 or 8 days?

[Previous page](https://forum.storj.io/t/how-do-i-empty-the-trash/15485.md?page=1)

[Next page](https://forum.storj.io/t/how-do-i-empty-the-trash/15485.md?page=3)
