View previous topic ::
View next topic
|
Author |
Message |
blablublaber
Cadet 4
Joined: Sep 04, 2012
Member#: 33525
Posts: 16
Location: munich, english garden
|
Posted:
Sat Feb 09, 2013 5:29 am Post subject: upload just in time |
|
the current overwriting all tracks in SST will probably take another 5 weeks
until it is finished we will still see "skippd tracks" in the Q
my suggestion is in addition to the slow upload all files to build an "on demand upload"
any track that is in the Q should get "priority" thus we would stop the skipping tracks problem in about one hour and not end of march
it could be accomplished by something like a cronjob asking the database about whats in the Q and not jet updated, and just getting these files f.e. using scp form JERICS backup at home
of course i dont know the internal sst databases so i am only writing some psudo code:
## database
create table sst_updates( songID int, asin varchar(255) , timestamp int , primary key(songID));
## cronjob all 10 min:
foreach
(select songID from sst_Q left outer join sst_updates using songID do
scp JERRIC@home:/backup/songID SST:/music/songID && mysql insert into sst_updates songID,asin, time();
done |
|
|
molossus
Admiral (Administrator)
Joined: Aug 09, 2005
Member#: 11167
Posts: 3312
Location: Warsaw & once in a blue moon Szczecin (Poland)
|
Posted:
Sat Feb 09, 2013 12:25 pm Post subject: |
|
Sounds interesting. _________________ <i>"The piano keys are black and white,
But they sound like a million colors in your mind"</i>
(from "Spider's Web" by <a href="http://katiemelua.com/music/#KatieMelua">Katie Melua</a>)
Avatar is from work of art by Drew Struzan |
|
|
diginferno
Rear Admiral (Ambassador)
Joined: Apr 15, 2006
Member#: 14160
Posts: 25
Location: Bucharest, Romania
|
Posted:
Sun Feb 10, 2013 5:36 pm Post subject: |
|
And who, pray tell, would tend to that "on-demand upload list" and sift through terabytes of tracks to make it happen? I trust that you realize that a human or twenty would be required to do it manually... _________________ diginferno
.::If my answers frighten you then you should cease asking scary questions::. |
|
|
blablublaber
Cadet 4
Joined: Sep 04, 2012
Member#: 33525
Posts: 16
Location: munich, english garden
|
Posted:
Sun Feb 10, 2013 7:47 pm Post subject: |
|
no human interaction required.
i am writing about a script running on sst and the other stations
(it would run on the 24/7 server and check periodically if all the tracks who are soon to be played (already in the Q) are there and the checksums fit to the backup.
if not it would upload the missing /damaged track
making checksums for a terabyte of files costs less than 24 hours so how long does it take to check them all? |
|
|
diginferno
Rear Admiral (Ambassador)
Joined: Apr 15, 2006
Member#: 14160
Posts: 25
Location: Bucharest, Romania
|
Posted:
Mon Feb 11, 2013 5:41 am Post subject: |
|
Script for Windows? I admit I am not that good. _________________ diginferno
.::If my answers frighten you then you should cease asking scary questions::. |
|
|
blablublaber
Cadet 4
Joined: Sep 04, 2012
Member#: 33525
Posts: 16
Location: munich, english garden
|
Posted:
Tue Feb 12, 2013 1:32 am Post subject: |
|
well we got php it works on linux and windows.
its not ideal but ok in this case since we need some binding to the database to get the current playlist
and then some function like "$hash=md5_file($filename)" can work on the problem on the server side.
i would prefer doing these things on linux too , but we can make do what we got.
having hashes of all the music files on the server and in the backup could save us a lot of time since only some 1/3 to 1/10 is broken/missing and needs fixing.
Code: |
<?php
$hash=array();
foreach(get_current_playlist_filenames() as $filename){
$hash[]=md5_file($filename);
}
file_put_contents("server_hashes", implode('\n',$hash));
/** now compare to the ones from the backup and upload missing or wrong*/
?>
|
|
|
|
diginferno
Rear Admiral (Ambassador)
Joined: Apr 15, 2006
Member#: 14160
Posts: 25
Location: Bucharest, Romania
|
Posted:
Tue Feb 12, 2013 3:13 pm Post subject: |
|
You got me there. I never considered using PHP CLI. _________________ diginferno
.::If my answers frighten you then you should cease asking scary questions::. |
|
|
|