Skip to content
This repository has been archived by the owner on Apr 23, 2019. It is now read-only.

Commit

Permalink
Merge branch 'local'
Browse files Browse the repository at this point in the history
  • Loading branch information
awead committed Dec 13, 2011
2 parents 8135b1f + f79d272 commit ff58184
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 31 deletions.
1 change: 1 addition & 0 deletions bin/dra-video
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ $config->define( "videoErrorLog=s" );
$config->define( "videoTransLog=s" );
$config->define( "videoLog=s" );
$config->define( "videoTypeList=s" );
$config->define( "localBlock=s" );

# Command line switches
$config->define("f!");
Expand Down
82 changes: 51 additions & 31 deletions bin/dra-video-run
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ $config->define( "logDir=s" );
$config->define( "mdssErrorLog=s" );
$config->define( "mdssLog=s" );
$config->define( "remoteBlock=s" );
$config->define( "localBlock=s" );
$config->define( "rsyncLog=s" );
$config->define( "semester=s" );
$config->define( "sentToBeBurnedLog=s" );
Expand All @@ -86,31 +87,10 @@ $config->file("$confFile");
$config->args();

# Initialize only the variables we'll be using here
my $draServer = $config->get( "draServer" );
my $draUser = $config->get( "draUser" );
my $draKey = $config->get( "draKey" );
my $audioDir = $config->get( "audioDir" );
my $semester = $config->get( "semester" );
my $remoteBlockList = $config->get( "remoteBlock" );
my $remoteErrorLog = $config->get( "errorLog" );
my $remoteTransferLog = $config->get( "copiedLog" );
my $remoteMdssLog = $config->get( "mdssLog" );
my $remoteMdssErrorLog = $config->get( "mdssErrorLog" );
my $videoLog = $config->get( "videoLog" );
my $videoErrorLog = $config->get( "videoErrorLog" );
my $videoTransLog = $config->get( "videoTransLog" );
my $logDir = $config->get( "logDir" );
my $hallList = $config->get( "hallList" );
my $sshOpts = $config->get( "sshOpts" );
my $hsi = $config->get( "hsi" );
my $hsiOptLine = $config->get( "hsiOpts" );
my $hsiPorts = $config->get( "hsiPorts" );
my $htar = $config->get( "htar" );
my $htarOptLine = $config->get( "htarOpts" );
my $htarUser = $config->get( "htarUser" );
my $keytab = $config->get( "keytab" );
my $tempDir = $config->get( "tempDir" );
my $videoDirs = $config->get( "videoDirs" );
my $blockList = $config->get( "localBlock" );

# Initialize command line switches
my $force = $config->get("f");
Expand All @@ -122,35 +102,75 @@ if ( $config->get("help") ) {
}

# Check our local block list
#my $run = DRA::checkBlocks($blockList);
#if ($run) {
# croak($run);
#}

my $run = DRA::checkBlocks($blockList);
if ($run) {
croak($run);
}

# ----------------------------------------------------------------------------
#
# Do some stuff
#
# ----------------------------------------------------------------------------

my @errors;
my $bin = Path::Class::Dir->new( $ENV{DRA_HOME}, "bin" );
my $logFile = Path::Class::File->new( $logDir, $videoLog );

my %errors;

DRA::logger("dra-video-run starting...", $logFile);

# Gather list of directories
my @sourceDirs;
my @sources = split / /, $videoDirs;
foreach my $source (@sources) {

my @dirs = DRA::readDirectory($source);
push @sourceDirs, @dirs;

foreach my $dir (@dirs) {
if ( $dir =~ /^20/ and $dir =~ /^\d{8,8}/) {
my $path = Path::Class::Dir->new($source, $dir);
push @sourceDirs, $path;
}
}
}

# Run dra-video on a set of directories
foreach my $projectDir (@sourceDirs) {
DRA::logger("Processing video project -- $projectDir", $logFile);

my $transferCommand = Path::Class::File->new( $bin, "dra-video" );
my ($t_out, $t_err, $t_success, $t_exit_code) =
IO::CaptureOutput::capture_exec($transferCommand, $projectDir);

if ( $t_err or $t_out ) {
DRA::logger("...script FAILED. Skipping to next folder", $logFile);
my $message
= "dra-video output: " . $t_out . "\n\n"
. "dra-video errors: " . $t_err . "\n\n"
;
$errors{$projectDir} = $message;
next;
}
else {
DRA::logger("...ok", $logFile);;
}

}

# Report any errors to stdout
if (%errors) {

DRA::logger("DRA video run complete, but with errors", $logFile);
print "dra-video-run finished with the following errors:\n\n";

foreach my $error ( keys %errors ) {
print $error . ":\n" . $errors{$error};
}
}
else {
DRA::logger("DRA video run complete with no errors.", $logFile);
}

exit 0;


# ----------------------------------------------------------------------------
Expand Down
3 changes: 3 additions & 0 deletions conf/video.conf
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ videoErrorLog = video_transfer_error.log
# will exit immediately without doing anything else.
remoteBlock = dra-transfer dra-convert dra-mdss dra-run

# Local block list
localBlock = compressord

# hsi and htar settings

# Full path to keytab will be appended to hsiOpts
Expand Down

0 comments on commit ff58184

Please sign in to comment.