Advanced search  

News:

cpg1.5.46 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter recently discovered vulnerabilities. It is important that all users who run version cpg1.5.44 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: Is there a way to find unused junk files in user dir  (Read 1572 times)

0 Members and 1 Guest are viewing this topic.

netb

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 65
Is there a way to find unused junk files in user dir
« on: March 21, 2014, 10:52:24 PM »

Hello, I've stumbled upon an interesting case.

So in some cases where something happens, I can't remember exactly but like the file doesn't upload, the size limit is hit or the resizing isn't finished and something similar -- you or the gallery stops the upload -- and then you decide to re-upload the same file.

I've noticed that sometimes the previous uploading of the file has completed and it is actually in the user directory but the gallery doesn't know and it doesn't exits in the database either, so the gallery of course renames the new file with a suffix like ~0 at the end. But if you don't upload a file with the exact same name again this "unused" file stays in the folder and takes place.

And finally my question is, could you suggest some way to find such leftover unused files (which aren't in the database) in the user folders, so they can be deleted.

My gallery - greatmusclebodies.com
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15277
Re: Is there a way to find unused junk files in user dir
« Reply #1 on: March 27, 2014, 03:11:31 PM »

There's an (unreleased) plugin "check_files" in our SVN repository: http://sourceforge.net/p/coppermine/code/HEAD/tree/branches/cpg1.5.x/plugins/check_files/

It started as a mod for my private cpg1.4.x gallery a lot of years ago and I converted it to a cpg1.5.x plugin about 2 years ago. If I remember correctly it works as expected, but for some reason I haven't released it (or I simply forgot to release it). However, you still can use it!

You need to create a folder "check_files" in your Coppermine's plugins directory and upload all plugin files into that directory. Then, install the plugin as described in the Coppermine docs. The button "Search for additional files" in the menu is what you're looking for.
Logged

netb

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 65
Re: Is there a way to find unused junk files in user dir
« Reply #2 on: March 31, 2014, 11:42:53 PM »

Thank you, Αndré!

Works really great and checks for both missing or additional files in the gallery, which I had both and did the manual job to remove them by hand :-\. Didn't find any new ones, but tested the plugin by dropping some new files and it's really useful, it found them. It's a very helpful plugin for maintenance of the files in the gallery.
Logged

gmc

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 686
    • GMC Design Photo Gallery
Re: Is there a way to find unused junk files in user dir
« Reply #3 on: October 25, 2016, 08:57:16 PM »

Stumbled on this thread looking for a way to deal with large numbers of missing and extra files in albums directory...
It worked as advertised - but needed to extend it a bit.

Changes made:
  • Added support to view of additional files to report if the same filename exists elsewhere in the gallery.
  • Excluded 'no_FTP-uploads...' file and files beginning with '.' (like .htaccess) from additional file reporting
  • Added delete support for additional files - choice of all or 'duplicate' (same filename elsewhere in gallery) - and just main file or all related.
    See pic attached. This was the piece I really needed...
  • Added support for cleaning up favpics when deleting missing files from CPG.
    (favpics stored as base64 encoded serialized array that each need to be retrieved, reviewed, and updated if needed...)
  • Changed all mysql references to CPG functions for 1.6 compatibility
    (raised MIN level of CPG required to 1.5.42 where these functions were added)
  • Updated version to 0.3
All changes clearly noted by //*GMC comments.

Αndré - do you want to update the SVN?  or want it released as a formal plugin? or both?
Attached as plugin zip...
« Last Edit: October 25, 2016, 09:31:24 PM by gmc »
Logged
Thanks!
Greg
My Coppermine Gallery
Need a web hosting account? See my gallery for an offer for CPG Forum users.
Send me money

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15277
Re: Is there a way to find unused junk files in user dir
« Reply #4 on: November 14, 2016, 11:51:14 PM »

Greg, I'll have a closer look at your changes as soon as possible and will update the files in the SVN repository accordingly.
Logged
Pages: [1]   Go Up
 

Page created in 0.071 seconds with 20 queries.