#1  
Old April 21st, 2012, 06:51 AM
ultradj83 ultradj83 is offline
Junior Member
NETGEAR Newbie
 
Join Date: Feb 2012
Posts: 32
ultradj83 is on a distinguished road
Question Script for to clear and rebuild MiniDLNA database

Hello there.


When I modify many multimedia files into the Stora, the MiniDLNA database is not correctly updated, I find doubled entries and other issues, so I need to rebuild the dataase.

To do this via bash takes no more then 10 minutes to have the database rebuilt, but to make it faster I'd like to write a script that stops the MiniDLNA, deletes database files and initiates a rebuild.

Here it is:
!/bin/sh
# Stop MINIDLNA
/etc/init.d/minidlna.init stop
# Delete database files
rm /tmp/minidlna/files.db
rm /tmp/minidlna/minidlna.log
rm -rf /tmp/minidlna/art_cache
# Rebuild MINIDNA database
/usr/sbin/minidlna -R -f /etc/miniupnpd/minidlna.conf
# Show MINIDLNA status
/etc/init.d/minidlna.init status
I launch it as superuser, but it doesn't work.
MiniDLNA commands return the quick help, like as arguments are ignored, and rm commands return no such file or folder.

Well, this is my 1st script, what's wrong?

I use exactly the same commands I enter from bash, with the same user and sudoed.

Can anybody help me?


Thanks!!
Reply With Quote
  #2  
Old April 21st, 2012, 12:04 PM
Southkil's Avatar
Southkil Southkil is offline
Senior Member
NETGEAR Expert
 
Join Date: Sep 2010
Posts: 620
Southkil is on a distinguished road
Default Re: Script for to clear and rebuild MiniDLNA database

Could you not just, via web gui or nomad, unshare via dma and then reshare?

Reply With Quote
  #3  
Old April 21st, 2012, 01:02 PM
ultradj83 ultradj83 is offline
Junior Member
NETGEAR Newbie
 
Join Date: Feb 2012
Posts: 32
ultradj83 is on a distinguished road
Default Re: Script for to clear and rebuild MiniDLNA database

This doesn't solve problems, because if I don't delete files db is updated, not refreshed...
Reply With Quote
  #4  
Old April 21st, 2012, 01:06 PM
ultradj83 ultradj83 is offline
Junior Member
NETGEAR Newbie
 
Join Date: Feb 2012
Posts: 32
ultradj83 is on a distinguished road
Default Re: Script for to clear and rebuild MiniDLNA database

This doesn't solve problem because if I don't delete files db is not rebuilt, only refreshed...
Reply With Quote
  #5  
Old April 27th, 2012, 02:25 PM
gypsy gypsy is offline
Junior Member
NETGEAR Newbie
 
Join Date: Sep 2010
Posts: 20
gypsy is on a distinguished road
Arrow Re: Script for to clear and rebuild MiniDLNA database

MiniDLNA has a bug that results in duplicated directory entries. It has been fixed in the latest version of MiniDLNA. I am hoping that a new version of the Stora firmware will be released that includes this updated MiniDLNA.

http://forum1.netgear.com/showpost.p...66&postcount=1
Reply With Quote
  #6  
Old June 9th, 2012, 11:02 AM
mentatpsi mentatpsi is offline
Junior Member
 
Join Date: Jun 2012
Posts: 1
mentatpsi is on a distinguished road
Default Re: Script for to clear and rebuild MiniDLNA database

Ya, it didn't work for me either... but the newer version of minidlna supports the following commands:

Rebuilding:
sudo minidlna -R

Restarting minidlna service:
sudo service minidlna restart

So I designed the following unix script:

Code:
#!/bin/bash
sudo minidlna -R
sudo service minidlna restart
It's pretty straight forward.
Reply With Quote
  #7  
Old June 11th, 2012, 03:38 AM
ossienet ossienet is offline
Junior Member
NETGEAR Newbie
 
Join Date: Jan 2011
Posts: 200
ossienet is on a distinguished road
Default Re: Script for to clear and rebuild MiniDLNA database

Quote:
Originally Posted by Southkil View Post
Could you not just, via web gui or nomad, unshare via dma and then reshare?

Yes. This achieves the exact same result doesn't it?
Reply With Quote
  #8  
Old June 19th, 2012, 03:47 AM
craigchambers's Avatar
craigchambers craigchambers is offline
Junior Member
NETGEAR Newbie
 
Join Date: Nov 2011
Location: UK
Posts: 46
craigchambers is on a distinguished road
Default Re: Script for to clear and rebuild MiniDLNA database

Using the -R switch looks to have fixed your problem, but just for info:

On the Stora I administer, I was unable to locate the database used by miniDLNA. I needed to do this to run a cron job to update the sqlite DB to periodically rewrite the entries for HD m2ts files with mp2 audio.

I'm an old hand with miniDLNA, but I was totally stumped because the DB wasn't in any likely location.
I discovered that you can manually set the location of the DB in the config file. This allowed me to access it with my cron job.

Hope this is helpful to someone,
Craig
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT -8. The time now is 06:11 PM.