× Introducing the Orbi 970 Series Mesh System with WiFi 7 technology. For more information visit the NETGEAR Press Room.
Orbi WiFi 7 RBE973
Reply

Script for to clear and rebuild MiniDLNA database

ultradj83
Novice

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!!
Message 1 of 8
Southkil
Aspirant

Re: Script for to clear and rebuild MiniDLNA database

Could you not just, via web gui or nomad, unshare via dma and then reshare? :)
Message 2 of 8
ultradj83
Novice

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...
Message 3 of 8
ultradj83
Novice

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...
Message 4 of 8
gypsy1
Aspirant

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.php?p=400566&postcount=1
Message 5 of 8
mentatpsi
Novice

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:

#!/bin/bash
sudo minidlna -R
sudo service minidlna restart


It's pretty straight forward.
Message 6 of 8
ossienet
Aspirant

Re: Script for to clear and rebuild MiniDLNA database

Southkil wrote:
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?
Message 7 of 8
craigchambers
Aspirant

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
Message 8 of 8
Discussion stats
  • 7 replies
  • 44269 views
  • 0 kudos
  • 6 in conversation
Announcements

Orbi WiFi 7