#183410 - 07/10/2003 19:12
fidsift.sh -- rearrange /drive?/fids/ into subdirs
|
mlord
carpal tunnel
Registered: 29/08/2000
Posts: 9841
Loc: Canada
|
Quite some time ago, the player software was enhanced to be able to deal with /fids/ directories that are broken up into smaller subdirs. This can speed up database rebuilds and filesystem checks etc, and is a worthwhile thing to have.
The Emplode and emptool software still just upload everything into /drive?/fids/, but the player software (and Hijack) can handle things in either format, including a mix of the two methods.
So.. here's my small script for (re)sifting the tune and tag files into appropriate subdirs, on a one or two drive RioCar/Empeg player.
To use, upload via FTP to /fidsort.sh, and set the exec permissions:
ftp myplayer
site rw
cd /
put fidsift.sh
chmod 0755 fidsift.sh
site ro
quit
Then connect via the serial port, hit control^C to gain control of the player, and do this command: /fidsift.sh
Then go and have coffee or cola, and when you get back it will eventually finish, and you can view the results in /drive0/fids/ and /drive1/fids/. As new tunes are later uploaded, unsifted files will acculumate again, and you might want to periodically rerun the script in the same way as the first time, to sift the newly uploaded tunes into their subdirs (not necessary, but nice).
The script is attached -- EDIT: there's a better version later in this thread..
Cheers
Attachments
182162-fidsift.sh (253 downloads) Description:
Edited by mlord (07/10/2003 22:29)
|
|
Top
|
|
|
|
#183412 - 07/10/2003 21:41
Re: fidsift.sh -- rearrange /drive?/fids/ into sub
[Re: SE_Sport_Driver]
|
mlord
carpal tunnel
Registered: 29/08/2000
Posts: 9841
Loc: Canada
|
Now that could be very educational!
I'm also wondering if the script will just crap out with that many fids.. go ahead and give it a whirl!
(it won't actually damage anything if it does crap out.. maybe I'll try a test here..)
|
|
Top
|
|
|
|
#183417 - 07/10/2003 22:03
Re: fidsift.sh -- rearrange /drive?/fids/ into sub
[Re: mlord]
|
image
old hand
Registered: 28/04/2002
Posts: 770
Loc: Los Angeles, CA
|
can hijack be modified to run this script automatically after uploading? like i would love it before the player restarts, so the player would still be expected to be in rw mode.
|
|
Top
|
|
|
|
#183419 - 07/10/2003 22:16
Re: fidsift.sh -- rearrange /drive?/fids/ into sub
[Re: mlord]
|
mlord
carpal tunnel
Registered: 29/08/2000
Posts: 9841
Loc: Canada
|
Okay, here's a slightly improved version.
This one shrinks the /fids/ directory afterwards to improve lookups further, and also copes correctly with a /fids/ directory that contains no files.
Cheers
Attachments
182190-fidsift.sh (305 downloads) Description:
|
|
Top
|
|
|
|
#183431 - 07/10/2003 23:45
Re: Way to go Mark!
[Re: SE_Sport_Driver]
|
loren
carpal tunnel
Registered: 23/08/2000
Posts: 3820
Loc: SLC, UT, USA
|
Sweeet. Nice job Mark. So can we expect this to be built into hijack soon? If so i think i'll wait. I'm going to be completely rebuilding my player soon anyhow. It would rock if this could be run after a certain number of tracks have been added. Could Jemplode do this somehow??
|
|
Top
|
|
|
|
#183432 - 07/10/2003 23:49
Re: Way to go Mark!
[Re: loren]
|
mlord
carpal tunnel
Registered: 29/08/2000
Posts: 9841
Loc: Canada
|
Mmm.. Well, JEmplode over ethernet could use FTP for the file transfers, in which case it could just use the new subdir structure as it uploads tracks. Maybe Mike will add that someday.
I don't know about building it into Hijack -- so don't wait for that to happen. Once I someday implement the "run a command from the menu" feature it will be trivial to do. But I keep getting distracted here..
This is pretty simple to do as-is.. and even if it's only done once it will still make a difference. The only tricky bit is getting the script onto the player, but that only need be done the first time. From then on, it's still there and can be run just by hitting control^c and typing it's name (using the serial link). And it's only slow the first time!
Sleep time..
Cheers
|
|
Top
|
|
|
|
#183433 - 08/10/2003 02:47
Re: fidsift.sh -- rearrange /drive?/fids/ into sub
[Re: mlord]
|
Foz
member
Registered: 24/10/2000
Posts: 106
Loc: San Jose, CA
|
Is this thing safe under the V3 alpha kernel?
-- Gary F.
Eeyore, Original Owner -- Mk II 80 Gb, Blue
S/N #090000803
Tigger, 2nd Owner -- Mk IIa, 80 Gb, Blue
S/N #40103789
|
|
Top
|
|
|
|
#183434 - 08/10/2003 03:18
Re: fidsift.sh -- rearrange /drive?/fids/ into sub
[Re: Foz]
|
simspos
enthusiast
Registered: 28/03/2002
Posts: 229
Loc: Dudley, UK
|
Nice work Mark,.... people of the world (with obscenely large music collections) Rejoice!
|
|
Top
|
|
|
|
#183437 - 08/10/2003 10:34
Oh no! A serious flaw!
[Re: mlord]
|
mlord
carpal tunnel
Registered: 29/08/2000
Posts: 9841
Loc: Canada
|
Okay, there's a flaw with this scheme.
When syncing with Emplode or emptool, the player stores new/modified FIDS in the top level /driveX/fids/ directory, rather than the subdirs. Same when doing deletes. Nothing wrong with that, other than some duplication.
BUT.. the player software does NOT search the top level directory if it finds a subdir.. OUCH. I was under the impression that it was smart enough to look in the right order, but it is actually even smarter than that -- smart enough not to "waste" the effort. This is a good thing, but it means that you MUST re-run fidsift.sh after each sync(Ugh!), and even that won't properly delete things.
Okay, I'll fix this, in the Hijack kernel, so that the player does "the right thing" whether it wants to or not. Later today, or tomorrow.
The plan is have the kernel automatically remap ALL /fids/ accesses to the subdirs when they (subdirs) exist. This way, syncs which affect existing fids will work correctly. New uploads can still be dropped into the top level /fids/ directories, if no appropriate subdir exists at the time. Not an issue for now.
Cheers
|
|
Top
|
|
|
|
#183438 - 08/10/2003 11:56
Re: Oh no! A serious flaw!
[Re: mlord]
|
image
old hand
Registered: 28/04/2002
Posts: 770
Loc: Los Angeles, CA
|
my solution.
;@AC ;@EXEC /bin/fidsift.sh
cant use ;@EXEC_ONCE because that only executes after a reboot.
unless you uploaded over 500 files, the time diff is unnoticable.
|
|
Top
|
|
|
|
|
|