Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
Script for to clear and rebuild MiniDLNA database
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2012-04-21
07:51 AM
2012-04-21
07:51 AM
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:
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!!
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
# 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
Labels:
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2012-04-21
01:04 PM
2012-04-21
01:04 PM
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
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2012-04-21
02:02 PM
2012-04-21
02:02 PM
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
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2012-04-21
02:06 PM
2012-04-21
02:06 PM
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
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2012-04-27
03:25 PM
2012-04-27
03:25 PM
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
http://forum1.netgear.com/showpost.php?p=400566&postcount=1
Message 5 of 8
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2012-06-09
12:02 PM
2012-06-09
12:02 PM
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:
It's pretty straight forward.
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
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2012-06-11
04:38 AM
2012-06-11
04:38 AM
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
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2012-06-19
04:47 AM
2012-06-19
04:47 AM
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
Announcements
• What is the difference between WiFi 6 and WiFi 7?
• Yes! WiFi 7 is backwards compatible with other Wifi devices? Learn more