To get around this problem, I've written the following script. It seems to
work well.
#!/usr/bin/perl
# IMPORT DROPBOX FILES
use File::Copy;
sub already {
open PS, "/bin/ps wwfaux |";
@PS = <PS>;
close PS;
$count = 0;
foreach (@PS) {
$count++ if (/$0/);
}
return $count;
}
sub log {
my $a = shift;
my $t = localtime(time);
if (open (LOG,">>$LOG")) {
print (LOG "$t\t$a\n");
close LOG;
}
}
# ==> MAIN PROGRAM
$WAIT = 10;
$BOX = '/home/scott/import';
$BAD = '/home/scott/import/bad';
$LOG = '/home/scott/log/import.log';
$RDI = 'rdimport --autotrim-level=0 --normalization-level=-13 '.
'--delete-cuts --delete-source';
if (&already < 2) {
if (opendir(BOX,$BOX)) {
while ($group = readdir BOX) {
if ($group gt '..') {
$g = "$BOX/$group";
if (-d $g) {
if ($g ne $BAD) {
if (opendir(GROUP,$g)) {
while ($file = readdir GROUP) {
$f = "$g/$file";
if (-f $f) {
$m = (stat($f))[9];
$t = time;
if (($t - $m) > $WAIT) {
$c = "$RDI $group '$f'";
system($c);
if (-f $f) {
move ($f,$BAD);
&log("ERROR: $c");
} else {
&log($f);
}
} else { &log("NOT READY: $f") }
}
}
closedir GROUP;
}
}
}
}
}
closedir BOX;
} else { &log("ERROR: Can\'t open $BOX") }
} else {&log("Already running")}
On Wed, 5 Mar 2014, Rob Landry wrote:
More information:
The files being truncated are long files -- longer than 10 minutes -- copied
from a Windows machine vis samba. Rivendell seems to be trying to import them
before they've finished copying. The resulting imported file is listed in
rdlibrary weith the correct length, but when I look at it using Edit Markers,
there's only about 15 minutes of audio in it and the rest is blank.
If I set up the dropbox not to delete the original file, and then I make a
copy of the original in the dropbox, the copy imports perfectly.
What criterion does Rivendell use to decide that a file being copied into a
dropbox is complete? Can it be adjusted?
Rob
On Sat, 22 Feb 2014, Rob Landry wrote:
One of my stations is routinely having files trunceted when they are
imported via dropbox. The files beng affected are stereo .wav files 15
minutes of more in length.
I have checked the timeout on Apache and it is set to 1200 seconds, so this
shouldn't be happening.
This is RD 2.2.0 running on Debian 7 on brand new hardware.
Rob
_______________________________________________
Rivendell-dev mailing list
[email protected]
http://caspian.paravelsystems.com/mailman/listinfo/rivendell-dev
_______________________________________________
Rivendell-dev mailing list
[email protected]
http://caspian.paravelsystems.com/mailman/listinfo/rivendell-dev
_______________________________________________
Rivendell-dev mailing list
[email protected]
http://caspian.paravelsystems.com/mailman/listinfo/rivendell-dev