IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 30529


Ignore:
Timestamp:
Feb 8, 2011, 5:59:17 PM (15 years ago)
Author:
bills
Message:

use tempdir() to set up the temporary directory. Running streaksreplace in the workdir causes
overload of ippc17

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/pstamp/scripts/pstamp_job_run.pl

    r30528 r30529  
    1414use File::Basename;
    1515use File::Copy;
    16 use File::Temp qw(tempfile);
     16use File::Temp qw(tempfile tempdir);
    1717use Digest::MD5::File qw( file_md5_hex );
    1818use PS::IPP::PStamp::RequestFile qw( :standard );
     
    155155            # Try and replace the streaks from the recovery images
    156156
    157             @file_list = ();
    158             $tmproot = "$outdir/$job_id";
    159             if (! -e $tmproot) {
    160                 mkdir $tmproot or
    161                     my_die( "failed to create temporary directory $tmproot", $job_id, $PS_EXIT_UNKNOWN_ERROR);
    162             }
     157            my $temp_dir = metadataLookupStr($ipprc->{_siteConfig}, "TEMP.DIR") or &my_die("Unable to find temporary directory in site configuration", $job_id, $PS_EXIT_CONFIG_ERROR);
     158            $tmproot = tempdir("$temp_dir/psjob.$job_id.XXXX", CLEANUP => !$save_temps);
    163159            my $muggle_command = "$streaksreplace -stage $stage -tmproot $tmproot";
    164160            # find the "directory" of the input path_base
     
    166162            my $base = basename($image);
    167163            $tmpImage = "$tmproot/$base";
     164
     165            @file_list = ();
    168166
    169167            # XXX: We should get the recovery_path_base from the magicDSFile but that requires a bunch of file rule and
     
    231229    }
    232230
    233     if (!$save_temps) {
    234         unlink $tmpImage if $tmpImage;
    235         unlink $tmpMask if $tmpMask;
    236         unlink $tmpVariance if $tmpVariance;
    237         rmdir $tmproot if $tmproot;
    238     }
    239 
    240231    if ($exitStatus == 0) {
    241232        my $reglist = "$outdir/reglist$job_id";
Note: See TracChangeset for help on using the changeset viewer.