Can we delete content of directory uploads///tombstone

סיכום מבוסס בינה מלאכותית

adopilot is trying to reclaim disk space on their Discourse instance, noting a large discrepancy between dashboard stats (55GB), PostgreSQL uploads (35GB), and filesystem usage (247GB total, with 191GB in /tombstone/). They suspect orphaned files in the tombstone directory — which holds deleted uploads for potential recovery — and ask if it’s safe to delete them. sam confirms tombstone is safe to clear and suggests checking file timestamps; adopilot finds most files date back to February 2020. zogstrip reminds them to also check optimized_images (20GB), which explains the dashboard discrepancy. sam suggests adjusting the site setting for how long deleted uploads are retained in tombstone. adopilot lowers the retention from 30 to 10 days, runs Sidekiq jobs, and successfully frees space. They apologize for opening the topic, admitting they overlooked the purge deleted uploads grace period days setting. They also suggest Discourse add a NEW indicator in settings to help admins track newly introduced options across versions.

I am trying to figure way to gain more space on my discource instance.

Here is some data I collected:

  • Discourse dashboard showing 55GB used for uploads.

  • Postgresql select pg_size_pretty(sum(filesize)) from uploads showing 35 GB

  • ssh du -sh /var/discourse/shared/standalone/uploads/ showing 247G

  • ssh du -sh /var/discourse/shared/standalone/uploads/default/original/ showing 35GB

  • ssh du -sh /var/discourse/shared/standalone/uploads/tombstone/ showing 191GB

Can be that there is orphans in tombstone or it is false positive that this folder takes 191GB
When I browsing tombstone folder there is thousands of folders and files.

What kind of files discource holding in /var/discourse/shared/standalone/uploads/tombstone/ is it safe to delete these files.

I am pretty sure you can junk all of tombstone, it is a holding ground for images that have been deleted. A place for “emergency recovery”.

In theory we should be clearing it out regularly.

Can you do a bit more research, what is the timestamp on say the oldest 10 files you have in tombstone? Are they ancient?

You have forgotten this query

select pg_size_pretty(sum(filesize)) from optimized_images

You are right optimized_images showing 20GB with which match diif from dashboard and uploads table.

Nope, if my linux commands are correct most of these files are february 2020 and so on

Maybe stuff is working properly and simply lots of stuff is getting deleted on your forum? You can amend the duration stuff is left in tombstone so it only stays there for a shorter time, there is a site setting for that I think.

In february I started fight for space, Maybe that why I did not get speace released still.
My Setting was on 30 days, when I did this lower to 10 and run sidekiq jobs regarding uploads my space , tombstone folder is now shrink.

Thank you on help, apologies for opening topic, I just did not noticed purge deleted uploads grace period days settings. Last time when I was clearing my forum it just needed to run sidekiq jobs and to return freespace to os.

Perhaps this shot be new topic: but please consider adding NEW notification in setting when something is new. For admins it is hard to keep step with all new settings, from version to version there is hard to spot and tune new settings discource offering us when we can’t find whic are newones.