On Fri, 7 Mar 2014, Aaron Read wrote:
I can get the remote drive on my SFX4104 satellite decoder to mount locally, and use GRSync to copy files to a local directory, and Dropbox will ingest them.
Don't use Rivendell dropboxes; write a script to run rdimport with the --delete-source option, and then -- this is important -- add a command to move any file that didn't get deleted to a "bad files" directory (e.g. /tmp/badfiles). Run this script at the top of each hour via crontab.
If you mount the SFX4104 as /data/xdcache, then the files you want will appear in /data/xdcache/CDLongname . However, these are actually symbolic links -- the equivalent of Windows shortcuts -- pointing to the actual files, which are in /data/xdcache/archive .
When a file appears in a Rivendell dropbox, rdimport tries to import it. Afterwards, the file stays in the dropbox unless you've specified --delete-source, in which case the files in the dropbox are deleted after import.
If the file isn't deleted, rdimport will not import it a second time. I'm not sure what criterion is used to determine that a file in the dropbox is the same file, as opposed to an identically named new file. However, my gut feeling is that because the files in /data/xdcache/CDLongname are symbolic links, they will always look like the same old file even when the files they point to are new ones, and, therefore, the dropbox mechanism won't work properly.
The following script should work for you. You can use crontab to run it every hour, or more often if necessary.
#!/usr/bin/perl # IMPORT CONTENT DEPOT FILES use File::Copy; # IF THE SCRIPT IS ALREADY RUNNING, DON'T START IT sub already { open PS, "/bin/ps wwfaux |"; @PS = <PS>; close PS; $count = 0; foreach (@PS) { $count++ if (/$0/); } return $count; } # KEEP A LOG OF ALL IMPORT ATTEMPTS 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; # wait 10 seconds after each file is last modified $GROUP = 'PRSS'; # change this to a valid Rivendell group $BOX = '/data/xdcache/CDLongname'; # path to SFX4104 $BAD = '/tmp/badfiles'; # unimportable files end up here $LOG = '/tmp/import.log'; # log file $RDI = 'rdimport --autotrim-level=0 --normalization-level=-13 '. '--delete-cuts --delete-source'; if (&already < 2) { if (opendir(BOX,$BOX)) { while ($file = readdir BOX) { $f = "$BOX/$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 BOX; } } _______________________________________________ Rivendell-dev mailing list Rivendell-dev@lists.rivendellaudio.org http://caspian.paravelsystems.com/mailman/listinfo/rivendell-dev