PDA

View Full Version : Rescanning from the command line?



Marc Sherman
2005-01-10, 06:34
Is there any way to start a rescan on the command line? I've got a
script that I run to drop new songs in my library, and I'd like to only
do a scan when I run that script.

Thanks,
- Marc

Marc Sherman
2005-01-10, 06:50
Marc Sherman wrote:
> Is there any way to start a rescan on the command line? I've got a
> script that I run to drop new songs in my library, and I'd like to only
> do a scan when I run that script.

Hrm. Slimserver seems to run scanning in the background, automatically.
I'd like to disable this, as well, if that's possible.

Thanks again,
- Marc

mherger
2005-01-10, 07:02
Marc

>> Is there any way to start a rescan on the command line? I've got a
>> script that I run to drop new songs in my library, and I'd like to only
>> do a scan when I run that script.

Have a look at the CLI documentation included with SlimServer
http://yourserver:9000/html/docs/crestronCLI.html

> Hrm. Slimserver seems to run scanning in the background, automatically.
> I'd like to disable this, as well, if that's possible.

What operating system?

--

Michael

-----------------------------------------------------------
Help translate SlimServer by using the
SlimString Translation Helper (http://www.herger.net/slim/)

Marc Sherman
2005-01-10, 07:04
Michael Herger wrote:
>
> Have a look at the CLI documentation included with SlimServer
> http://yourserver:9000/html/docs/crestronCLI.html

Thanks very much.

>> Hrm. Slimserver seems to run scanning in the background,
>> automatically. I'd like to disable this, as well, if that's possible.
>
> What operating system?

Linux. Debian Sarge, to be exact. Does that make a difference?

- Marc

mherger
2005-01-10, 07:10
>> Have a look at the CLI documentation included with SlimServer
>> http://yourserver:9000/html/docs/crestronCLI.html
>
> Thanks very much.

Fine if this helped.

>>> Hrm. Slimserver seems to run scanning in the background,
>>> automatically. I'd like to disable this, as well, if that's
>>> possible.
>> What operating system?
>
> Linux. Debian Sarge, to be exact. Does that make a difference?

Of course it does: Windows does not know about init.d :-).

And I don't know too much about Debian... But I guess there's some folder
which contains the scripts that are run at startup (/etc/init.d/ & co.).
If your remove slimserver from that folder it won't start any more. How
did you install it? AFAIK there's no .deb available from SlimDevices?

--

Michael

-----------------------------------------------------------
Help translate SlimServer by using the
SlimString Translation Helper (http://www.herger.net/slim/)

Marc Sherman
2005-01-10, 07:16
Michael Herger wrote:
>
> And I don't know too much about Debian... But I guess there's some
> folder which contains the scripts that are run at startup (/etc/init.d/
> & co.). If your remove slimserver from that folder it won't start any
> more. How did you install it? AFAIK there's no .deb available from
> SlimDevices?

Nope, you misunderstood my question. I do want to keep running slimserver.

I don't want slimserver automatically re-scanning my libarary; I want it
to only rescan when I tell it to. Is that possible?

Thanks again,
- Marc

mherger
2005-01-10, 07:26
>> And I don't know too much about Debian... But I guess there's some
>> folder which contains the scripts that are run at startup
>> (/etc/init.d/ & co.). If your remove slimserver from that folder it
>> won't start any more. How did you install it? AFAIK there's no .deb
>> available from SlimDevices?
>
> Nope, you misunderstood my question. I do want to keep running
> slimserver.
>
> I don't want slimserver automatically re-scanning my libarary; I want it
> to only rescan when I tell it to. Is that possible?

Ok, ok... that's another story :-).

SlimServer does scan your collection when starting up or told to do so
manually using the web-interface. There's a plugin which can periodically
rescan your collection. Check "Server Settings/Plugins" if this is enabled.

--

Michael

-----------------------------------------------------------
Help translate SlimServer by using the
SlimString Translation Helper (http://www.herger.net/slim/)

Walter Wullschleger
2005-01-10, 10:32
.... and wipe too, since artwork is not refreshed with rescan.

rescann and wipe as a cmdl command would be very nice.

thx
walt

Marc Sherman wrote:

> Is there any way to start a rescan on the command line? I've got a
> script that I run to drop new songs in my library, and I'd like to
> only do a scan when I run that script.
>
> Thanks,
> - Marc
>

kdf
2005-01-10, 10:51
Quoting Walter Wullschleger <walter.wullschleger (AT) swissonline (DOT) ch>:

> ... and wipe too, since artwork is not refreshed with rescan.
>
> rescann and wipe as a cmdl command would be very nice.

on windows, wipe would be:
erase c:\program files\slimserver\server\Cache\slimserver.db

as of 6.0 :
erase c:\program files\slimserver\server\Cache\slimserversql.db


When you subsequently restart the server, it will detect the missing db and
beging a full rescan.
-kdf

Walter Wullschleger
2005-01-10, 11:09
kdf wrote:

>Quoting Walter Wullschleger <walter.wullschleger (AT) swissonline (DOT) ch>:
>
>
>
>>... and wipe too, since artwork is not refreshed with rescan.
>>
>>rescann and wipe as a cmdl command would be very nice.
>>
>>
>
>on windows, wipe would be:
>erase c:\program files\slimserver\server\Cache\slimserver.db
>
>as of 6.0 :
>erase c:\program files\slimserver\server\Cache\slimserversql.db
>
>
>When you subsequently restart the server, it will detect the missing db and
>beging a full rescan.
>-kdf
>
>
>

kdf
2005-01-10, 11:29
Quoting Walter Wullschleger <walter.wullschleger (AT) swissonline (DOT) ch>:


> ... oh i see. but i don't want to stop and restart the slimserver on my
> linux box (that's why i'm using linux). but as i understand your answer,
> i just have to remove the slimserver cache db and start a rescann. is
> that the way? if so, just missing the rescann as a "command line
> command" for using in a script.
>

If you dont want to restart teh service, then you have the option of the CLI
see your help section, technical information, The SlimServer Command-Line
Interface. Rescan is included there as a command. Wipe Cache is simply the
removal of the db, followed by a rescan command. A cleverly written script
should be able to handle both.

under linux, the db is found in ~/Cache/.slimserver.db
I bleieve the RPM uses /usr/local/slimserver/Cache/.slimserver.db

-kdf

Walter Wullschleger
2005-01-10, 12:04
kdf wrote:

>Quoting Walter Wullschleger <walter.wullschleger (AT) swissonline (DOT) ch>:
>
>
>
>
>>... oh i see. but i don't want to stop and restart the slimserver on my
>>linux box (that's why i'm using linux). but as i understand your answer,
>>i just have to remove the slimserver cache db and start a rescann. is
>>that the way? if so, just missing the rescann as a "command line
>>command" for using in a script.
>>
>>
>>
>
>If you dont want to restart teh service, then you have the option of the CLI
>see your help section, technical information, The SlimServer Command-Line
>Interface. Rescan is included there as a command. Wipe Cache is simply the
>removal of the db, followed by a rescan command. A cleverly written script
>should be able to handle both.
>
>under linux, the db is found in ~/Cache/.slimserver.db
>I bleieve the RPM uses /usr/local/slimserver/Cache/.slimserver.db
>
>-kdf
>

Scott Culverhouse
2005-01-10, 12:50
You could trying doing a wget or similar of

http://127.0.0.1:9000/Default/setup.html?page=server&rescan=rescan

This would simulate pressing the rescan button

Scott

On Mon, 10 Jan 2005 08:34:46 -0500
Marc Sherman wrote:

> Is there any way to start a rescan on the command line? I've got a
> script that I run to drop new songs in my library, and I'd like to only
> do a scan when I run that script.
>
> Thanks,
> - Marc
>

Avi Schwartz
2005-01-10, 15:07
Scott Culverhouse wrote:

>You could trying doing a wget or similar of
>
>http://127.0.0.1:9000/Default/setup.html?page=server&rescan=rescan
>
>This would simulate pressing the rescan button
>
>
>On Mon, 10 Jan 2005 08:34:46 -0500
>Marc Sherman wrote:
>
>
>
>>Is there any way to start a rescan on the command line? I've got a
>>script that I run to drop new songs in my library, and I'd like to only
>>do a scan when I run that script.
>>
>>
If you have python installed on the machine you could use something like:

#!/usr/bin/python

import telnetlib

HOST = "localhost"
PORT = 9090

tn = telnetlib.Telnet(HOST, PORT)
tn.write('rescan\n')
tn.write('exit\n')


--
Avi Schwartz
http://public.xdi.org/=avi.schwartz

When you have robbed a man of everything, he is no longer in your power. He is free again.

-- Alexander Solzhenitsyn

Marc Sherman
2005-01-11, 07:19
Marc Sherman wrote:
>
> I don't want slimserver automatically re-scanning my libarary; I want
> it to only rescan when I tell it to. Is that possible?

It seems I was a bit confused here. I had _deleted_ a few songs from my
library, and the Slimserver automatically noticed that and removed them
from the database -- I'd thought that meant it was rescanning, but it
turns out that it isn't.

Avi Schwartz wrote:
>
> If you have python installed on the machine you could use something like:
>
> #!/usr/bin/python
>
> import telnetlib
>
> HOST = "localhost"
> PORT = 9090
>
> tn = telnetlib.Telnet(HOST, PORT)
> tn.write('rescan\n')
> tn.write('exit\n')

I didn't try that, as I'm not a python guy (significant whitespace?
c'mon!) and don't want to have to maintain a script, however tiny, in a
language I'm not comfortable with. But I did try:

echo "rescan\nexit" | telnet localhost 9090

without success. I think there might have been timing issues with
telnet draining stdin before the other end is ready to start receiving
stuff on the connection.

Scott Culverhouse wrote:
> You could trying doing a wget or similar of
>
> http://127.0.0.1:9000/Default/setup.html?page=server&rescan=rescan

This ended up working, though for some reason I had to remove "Default/"
from the URL. Did the paths change in the current daily builds? I'm
running 5.4.0 release.

Here's the script snippet I ended up using:

echo "Invoking Slimserver library scan..."
wget -nv -O /dev/null \
"http://localhost:9000/setup.html?page=server&rescan=rescan"

If anyone wants to see my whole script, which encodes, tags, and
normalizes a days worth of ripped WAV files for my library, just ask.

Thanks for all the help,
- Marc