Possibly a simple one but having had a look through the Wiki I couldn’t see if it was possible.
I currently use a little shell script to do deep scans of sections when I add new media, (I use NAS storage so find this more reliable for me than a normal level scan and I find the web interface quite slow). This is fine and picks up media changes quite happily but I am left with things in a state where I need to empty the Trash if things have been removed.
Is there any way empty the trash for a section from the command line?
(Running 0.9.5.2 under Lion)
There’s currently no command line method to do this.
If you’re already running a script, though, then perhaps you could do it via HTTP? If you look in the PMS log when you empty the trash via the WebManager, you’ll see a line similar to this:
Dec 08, 2011 14:47:20 [0xb0491000] DEBUG - Request: PUT /library/sections/4/emptyTrash [127.0.0.1]<br />
So, if you maybe used something like curl to send the PUT HTTP command to http://localhost:32400/library/sections/YOURSECTIONNUMBER/emptyTrash then that might work for you.
Otherwise, I'd expect that enabling the "Empty trash automatically after every scan" option for the PMS would work, too. At least, I assume it's still applicable for scans initiated via the command line or HTTP.
Hmmm … yes I’ll give that a go with curl as I should be able to drop it into the script easily enough 
Many thanks!
Yep, the curl seems to work (at least the exclamation mark(s) are cleared after the PUT is performed against the section).
Cheers
Still no way to do this, I see. An extreme version would be to dump the whole thing just prior to scan, using --reset, but for large libraries, seems excessive. I too would like to be able to dump trash for one library section without having to set it for all libraries.
any update on this, its been a while…
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.