Index: trunk/ippScripts/scripts/magic_tree.pl
===================================================================
--- trunk/ippScripts/scripts/magic_tree.pl	(revision 18702)
+++ trunk/ippScripts/scripts/magic_tree.pl	(revision 18784)
@@ -33,17 +33,19 @@
 
 # Parse the command-line arguments
-my ($magic_id, $tess_id, $camera, $ra0, $dec0, $dbname, $outroot, $save_temps, $verbose, $no_update, $no_op);
+my ($magic_id, $tess_id, $camera, $ra0, $dec0, $dbname, $outroot,
+    $save_temps, $verbose, $no_update, $no_op, $redirect);
 GetOptions(
-           'magic_id=s'    => \$magic_id,   # Magic identifier
-           'tess_id=s'     => \$tess_id,    # Tessellation identifier
-           'camera=s'      => \$camera,     # Camera name
-           'ra=f'          => \$ra0,        # Boresight right ascension, radians
-           'dec=f'         => \$dec0,       # Boresight declination, radians
-           'dbname=s'      => \$dbname,     # Database name
-           'outroot=s'     => \$outroot,    # Output root name
-           'save-temps'    => \$save_temps, # Save temporary files?
-           'verbose'       => \$verbose,    # Print stuff?
-           'no-update'     => \$no_update,  # Don't update the database?
-           'no-op'         => \$no_op,      # Don't do any operations?
+           'magic_id=s'      => \$magic_id,   # Magic identifier
+           'tess_id=s'       => \$tess_id,    # Tessellation identifier
+           'camera=s'        => \$camera,     # Camera name
+           'ra=f'            => \$ra0,        # Boresight right ascension, radians
+           'dec=f'           => \$dec0,       # Boresight declination, radians
+           'dbname=s'        => \$dbname,     # Database name
+           'outroot=s'       => \$outroot,    # Output root name
+           'save-temps'      => \$save_temps, # Save temporary files?
+           'verbose'         => \$verbose,    # Print stuff?
+           'no-update'       => \$no_update,  # Don't update the database?
+           'no-op'           => \$no_op,      # Don't do any operations?
+           'redirect-output' => \$redirect,   # Redirect output?
            ) or pod2usage( 2 );
 
@@ -60,4 +62,7 @@
 $ipprc->define_camera($camera);
 
+my $logDest = $ipprc->filename("LOG.EXP", $outroot, $magic_id) or
+    &my_die("Missing entry from camera config", $magic_id, $PS_EXIT_CONFIG_ERROR);
+$ipprc->redirect_output($logDest) if $redirect;
 
 # Look for programs we need
