Index: trunk/Ohana/src/opihi/dvo/hosts.c
===================================================================
--- trunk/Ohana/src/opihi/dvo/hosts.c	(revision 34088)
+++ trunk/Ohana/src/opihi/dvo/hosts.c	(revision 34260)
@@ -2,4 +2,6 @@
 # include <glob.h>
 # define DVO_MAX_PATH 1024
+
+enum {TEMP_NONE, TEMP_DVO_RESULTS, TEMP_DVO_LOG, TEMP_RELPHOT_RESULTS, TEMP_RELPHOT_LOG};
 
 // functions to manage the remote hosts
@@ -10,4 +12,6 @@
     gprint (GP_ERR, "  commands:\n");
     gprint (GP_ERR, "    purge-temp : delete all tempfiles for this shell\n");
+    gprint (GP_ERR, "               : [-old-pid] [-all-pid] [-v] [-verbose] [-commit] [-type type]\n");
+    gprint (GP_ERR, "    get-results : determine name of RESULTS file\n");
     return FALSE;
   }
@@ -27,5 +31,4 @@
       remove_argument (N, &argc, argv);
       ALL_PID = TRUE;
-      remove_argument (N, &argc, argv);
     }
     
@@ -46,4 +49,25 @@
     }
     
+    // we have the following types of temp files:
+    // dvo.results.*.fits
+    // dvo.results.*.fits.log
+    // log.rlpc.* (relphot logs)
+    // relphot.catalog.subset.dat [no glob needed]
+    int TEMP_TYPE = TEMP_DVO_RESULTS;
+    if ((N = get_argument (argc, argv, "-type"))) {
+      TEMP_TYPE = TEMP_NONE;
+      remove_argument (N, &argc, argv);
+      if (!strcasecmp(argv[N], "dvo.results"))     TEMP_TYPE = TEMP_DVO_RESULTS;
+      if (!strcasecmp(argv[N], "dvo.log"))         TEMP_TYPE = TEMP_DVO_LOG;
+      if (!strcasecmp(argv[N], "relphot.results")) TEMP_TYPE = TEMP_RELPHOT_RESULTS;
+      if (!strcasecmp(argv[N], "relphot.log"))     TEMP_TYPE = TEMP_RELPHOT_LOG;
+      if (TEMP_TYPE == TEMP_NONE) {
+	gprint (GP_ERR, "USAGE: hosts purge-temp [-type (type)]\n");
+	gprint (GP_ERR, "  allowed types dvo.results, dvo.log, relphot.results, relphot.log]\n");
+	return FALSE;
+      }
+      remove_argument (N, &argc, argv);
+    }
+
     // XXX wrap this up in a function:
     char *CATDIR = GetCATDIR();
@@ -63,4 +87,9 @@
     }    
     
+    if (argc != 2) {
+      gprint (GP_ERR, "USAGE: hosts purge-temp [-all-pid] [-old-pid PID] [-verbose] [-commit]\n");
+      return FALSE;
+    }
+
     int i;
     for (i = 0; i < table->Nhosts; i++) {
@@ -68,7 +97,13 @@
       char name[DVO_MAX_PATH];
       if (ALL_PID) {
-	snprintf (name, DVO_MAX_PATH, "%s/dvo.results.*.*.fits", table->hosts[i].pathname);
+	if (TEMP_TYPE == TEMP_DVO_RESULTS)     snprintf (name, DVO_MAX_PATH, "%s/dvo.results.*.fits", table->hosts[i].pathname);
+	if (TEMP_TYPE == TEMP_DVO_LOG)         snprintf (name, DVO_MAX_PATH, "%s/dvo.results.*.fits.log", table->hosts[i].pathname);
+	if (TEMP_TYPE == TEMP_RELPHOT_RESULTS) snprintf (name, DVO_MAX_PATH, "%s/log.rlpc.*", table->hosts[i].pathname);
+	if (TEMP_TYPE == TEMP_RELPHOT_LOG)     snprintf (name, DVO_MAX_PATH, "%s/relphot.catalog.subset.dat", table->hosts[i].pathname);
       } else {
-	snprintf (name, DVO_MAX_PATH, "%s/dvo.results.%05d.*.fits", table->hosts[i].pathname, PID);
+	if (TEMP_TYPE == TEMP_DVO_RESULTS)     snprintf (name, DVO_MAX_PATH, "%s/dvo.results.%05d.*.fits", table->hosts[i].pathname, PID);
+	if (TEMP_TYPE == TEMP_DVO_LOG)         snprintf (name, DVO_MAX_PATH, "%s/dvo.results.%05d.*.fits.log", table->hosts[i].pathname, PID);
+	if (TEMP_TYPE == TEMP_RELPHOT_RESULTS) snprintf (name, DVO_MAX_PATH, "%s/log.rlpc.*", table->hosts[i].pathname);
+	if (TEMP_TYPE == TEMP_RELPHOT_LOG)     snprintf (name, DVO_MAX_PATH, "%s/relphot.catalog.subset.dat", table->hosts[i].pathname);
       }
       if (VERBOSE) gprint (GP_ERR, "checking %s\n", name);
@@ -108,6 +143,4 @@
   }
 
-  
-
   gprint (GP_ERR, "error: unknown hosts command %s\n", argv[1]);
   return FALSE;
