Advertisement:

Author Topic: How to delete orphan attachments files  (Read 2599 times)

Offline EL34

  • Jr. Member
  • **
  • Posts: 310
How to delete orphan attachments files
« on: March 21, 2014, 10:38:51 AM »
SMF1.1.19

Looking at my forums attachment file maintenance page shows that the total attachments are 14,838

Looking at the attachment folder on my server shows that there are 29,100 attachments in that folder.

First question is, does SMF delete the attachment files when you delete old post?
Second question would be, how can I figure out which attachment files are orphans, not linked to any post?

I want to slim down the attachments folder by deleting any non used files

Thanks
Forum History -> EZBoard -> YABB -> SMF 1.1.19 -> SMF 2.0.17

Offline a10

  • Charter Member
  • Sophist Member
  • *
  • Posts: 1,038
Re: How to delete orphan attachments files
« Reply #1 on: March 21, 2014, 02:41:45 PM »
Hello, is it pictures and using thumbnails? Then it's 14,838 x2.
29100 would be 'somewhat' in the correct range.

Attachment (and it's thumbnail) is deleted from server when deleted from post, or the post is deleted (at least always done that here).

As for how to locate\delete eventual orphans, I too would be interesting to know about that.

btw, EL34... Tube? Mullard?
2.0.18, ssl, php 7.4.18, 10.3.28-MariaDB
Mods: Contact Page, Like Posts, Responsive Curve, Search Focus Dropdown, Add Join Date to Post.

Offline EL34

  • Jr. Member
  • **
  • Posts: 310
Re: How to delete orphan attachments files
« Reply #2 on: March 21, 2014, 05:40:56 PM »
Hi a10,
I was wondering if the attachments got deleted when purging old post, so it seems that they do

counting the thumbnails makes sense
not all files have thumbnails so that makes the total count work out about right
All files do not need to be reduced if they are under a certain size

yes, EL34 is a valve/tube
name your brand, any brand, Mullard is a good one  :D
Forum History -> EZBoard -> YABB -> SMF 1.1.19 -> SMF 2.0.17

Offline a10

  • Charter Member
  • Sophist Member
  • *
  • Posts: 1,038
Re: How to delete orphan attachments files
« Reply #3 on: March 21, 2014, 06:48:05 PM »
Testing attachment behavior, making a post with some picture\thumbnail, seeing them as the 2 latest entries in folder on server, then delete the post, and refresh server list to check that latest 2 files gone.

...................
About EL34's, when young(er) used to buy new Mullard, Telefunken, Philips for my guitaramps. A few USD a piece, if one only knew then what the future would bring...
2.0.18, ssl, php 7.4.18, 10.3.28-MariaDB
Mods: Contact Page, Like Posts, Responsive Curve, Search Focus Dropdown, Add Join Date to Post.

Offline EL34

  • Jr. Member
  • **
  • Posts: 310
Re: How to delete orphan attachments files
« Reply #4 on: March 21, 2014, 07:00:42 PM »
Testing attachment behavior, making a post with some picture\thumbnail, seeing them as the 2 latest entries in folder on server, then delete the post, and refresh server list to check that latest 2 files gone.

...................
About EL34's, when young(er) used to buy new Mullard, Telefunken, Philips for my guitaramps. A few USD a piece, if one only knew then what the future would bring...

Yeah, I did the same test as you a little while ago with the post add, attachment, delete. check the server folders

You would be a rich man if you had stashed a bunch of those valves away.
Just like 50's Gibson & Fender guitars, Old fender amps,  AC cobras, shelby Mustangs, Gold and Silver coins, etc............................  ;D
Forum History -> EZBoard -> YABB -> SMF 1.1.19 -> SMF 2.0.17