Index: trunk/ippToPsps/perl/ippToPsps_run.pl
===================================================================
--- trunk/ippToPsps/perl/ippToPsps_run.pl	(revision 28701)
+++ trunk/ippToPsps/perl/ippToPsps_run.pl	(revision 28755)
@@ -15,18 +15,18 @@
 use ippToPsps::IppToPspsDb;
 
-
 # globals
-my ($verbose, $save_temps, $no_op, $no_update, $camera, $batchType, $output, $dvodb, $datastoreProduct, $survey, $singleExpId, $force, $initBatch, $help);
-
-# default values for certain globals
-$verbose = undef;
-$save_temps = undef; 
-$no_update = undef;
-$camera = 'GPC1';
-$output = undef;
-$singleExpId = undef;
-$datastoreProduct = undef;
-$force = undef;
-$initBatch = 0;
+my $camera = 'GPC1';
+my $batchType = undef;
+my $survey = undef;
+my $dvodb = undef;
+my $verbose = undef;
+my $save_temps = undef; 
+my $no_update = undef;
+my $output = undef;
+my $singleExpId = undef;
+my $datastoreProduct = undef;
+my $force = undef;
+my $initBatch = undef;
+my $dontTarNZip = undef;
 
 # get user args
@@ -42,4 +42,5 @@
         'no-update|u' => \$no_update,
         'force|f' => \$force,
+        'tarnzip|z' => \$dontTarNZip,
         );
 
@@ -68,10 +69,12 @@
 if (!defined $force) {
     print "* OPTIONAL: force if already processed :    -f\n"; $force = 0;}
+if (!defined $dontTarNZip) {
+    print "* OPTIONAL: don't tar and zip output :      -z\n"; $dontTarNZip = 0;}
     print "*\n*******************************************************************************\n";
 
 if ($quit) { exit; }
 
-my $gpc1Db = new ippToPsps::Gpc1Db("gpc1", "ippdb01", "ippuser", "ippuser", $verbose);
-my $ippToPspsDb = new ippToPsps::IppToPspsDb("ippToPsps", "ippdb01", "ipp", "ipp", $verbose);
+my $gpc1Db = new ippToPsps::Gpc1Db("gpc1", "ippdb01", "ippuser", "ippuser", $verbose, $save_temps);
+my $ippToPspsDb = new ippToPsps::IppToPspsDb("ippToPsps", "ippdb01", "ipp", "ipp", $verbose, $save_temps);
 
 # check we can run programs and get camera config
@@ -81,4 +84,5 @@
 
 if ($batchType eq "init") {$initBatch = 1;}
+else {$initBatch = 0;}
 process();
 
@@ -146,5 +150,5 @@
         if (!$surveyType) {next;}
 
-        $batchId = $ippToPspsDb->getNewBatchId($expId, $surveyType);
+        $batchId = $ippToPspsDb->getNewBatchId($expId, $surveyType, $batchType);
 
         # TODO quit here if no sensible batch ID
@@ -167,6 +171,8 @@
             if (writeBatchManifest($batchDir, $batch, $batchType, $surveyType, $filename, $minObjId, $maxObjId)) {
 
-                my $tarball = tarAndZipBatch($output, $batch);
-                if ($tarball && $datastoreProduct && publishToDatastore($batch, $output, $tarball)) {$published = 1;}
+                if (!$dontTarNZip) {
+                    my $tarball = tarAndZipBatch($output, $batch);
+                    if ($tarball && $datastoreProduct && publishToDatastore($batch, $output, $tarball)) {$published = 1;}
+                }
             }
 
