Index: trunk/ippTasks/destreak.pro
===================================================================
--- trunk/ippTasks/destreak.pro	(revision 33643)
+++ trunk/ippTasks/destreak.pro	(revision 33644)
@@ -317,5 +317,5 @@
   host         local
   periods      -poll 5
-  periods      -exec 120.
+  periods      -exec 120
   periods      -timeout 120
   npending     1
@@ -427,8 +427,15 @@
         set.workdir.by.camera $CAMERA $COMPONENT $OUTROOT $default_host WORKDIR
     end
-    sprintf logfile "%s/%s.mds.revert.%s.%s.%s.log" $WORKDIR $EXP_ID $MAGIC_DS_ID $STAGE_ID $COMPONENT
-
-    $run = magic_destreak_revert.pl --magic_ds_id $MAGIC_DS_ID --camera $CAMERA --stage $STAGE --stage_id $STAGE_ID --component $COMPONENT --path_base $PATH_BASE --cam_path_base $CAM_PATH_BASE --cam_reduction $CAM_REDUCTION --outroot $WORKDIR --logfile $logfile --replace $REPLACE --bothways $BOTHWAYS --magicked $MAGICKED --run-state $RUN_STATE --recovery_path_base $RECOVERY_PATH_BASE
-
+
+    if (("$RUN_STATE" == "goto_restored") && ("$STAGE" == "camera"))
+
+        sprintf logfile "%s.dsrestore.log" $PATH_BASE
+
+        $run = destreak_restore_camera.pl --magic_ds_id $MAGIC_DS_ID --camera $CAMERA  --cam_id $STAGE_ID --path_base $PATH_BASE --dbname $DBNAME --logfile $logfile
+
+    else
+        sprintf logfile "%s/%s.mds.revert.%s.%s.%s.log" $WORKDIR $EXP_ID $MAGIC_DS_ID $STAGE_ID $COMPONENT
+        $run = magic_destreak_revert.pl --magic_ds_id $MAGIC_DS_ID --camera $CAMERA --stage $STAGE --stage_id $STAGE_ID --component $COMPONENT --path_base $PATH_BASE --cam_path_base $CAM_PATH_BASE --cam_reduction $CAM_REDUCTION --outroot $WORKDIR --logfile $logfile --replace $REPLACE --bothways $BOTHWAYS --magicked $MAGICKED --run-state $RUN_STATE --recovery_path_base $RECOVERY_PATH_BASE
+    end
     add_standard_args run
 
