Changeset 34260 for trunk/Ohana/src/opihi/dvo/hosts.c
- Timestamp:
- Jul 31, 2012, 4:02:00 PM (14 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/opihi/dvo/hosts.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi/dvo/hosts.c
r34088 r34260 2 2 # include <glob.h> 3 3 # define DVO_MAX_PATH 1024 4 5 enum {TEMP_NONE, TEMP_DVO_RESULTS, TEMP_DVO_LOG, TEMP_RELPHOT_RESULTS, TEMP_RELPHOT_LOG}; 4 6 5 7 // functions to manage the remote hosts … … 10 12 gprint (GP_ERR, " commands:\n"); 11 13 gprint (GP_ERR, " purge-temp : delete all tempfiles for this shell\n"); 14 gprint (GP_ERR, " : [-old-pid] [-all-pid] [-v] [-verbose] [-commit] [-type type]\n"); 15 gprint (GP_ERR, " get-results : determine name of RESULTS file\n"); 12 16 return FALSE; 13 17 } … … 27 31 remove_argument (N, &argc, argv); 28 32 ALL_PID = TRUE; 29 remove_argument (N, &argc, argv);30 33 } 31 34 … … 46 49 } 47 50 51 // we have the following types of temp files: 52 // dvo.results.*.fits 53 // dvo.results.*.fits.log 54 // log.rlpc.* (relphot logs) 55 // relphot.catalog.subset.dat [no glob needed] 56 int TEMP_TYPE = TEMP_DVO_RESULTS; 57 if ((N = get_argument (argc, argv, "-type"))) { 58 TEMP_TYPE = TEMP_NONE; 59 remove_argument (N, &argc, argv); 60 if (!strcasecmp(argv[N], "dvo.results")) TEMP_TYPE = TEMP_DVO_RESULTS; 61 if (!strcasecmp(argv[N], "dvo.log")) TEMP_TYPE = TEMP_DVO_LOG; 62 if (!strcasecmp(argv[N], "relphot.results")) TEMP_TYPE = TEMP_RELPHOT_RESULTS; 63 if (!strcasecmp(argv[N], "relphot.log")) TEMP_TYPE = TEMP_RELPHOT_LOG; 64 if (TEMP_TYPE == TEMP_NONE) { 65 gprint (GP_ERR, "USAGE: hosts purge-temp [-type (type)]\n"); 66 gprint (GP_ERR, " allowed types dvo.results, dvo.log, relphot.results, relphot.log]\n"); 67 return FALSE; 68 } 69 remove_argument (N, &argc, argv); 70 } 71 48 72 // XXX wrap this up in a function: 49 73 char *CATDIR = GetCATDIR(); … … 63 87 } 64 88 89 if (argc != 2) { 90 gprint (GP_ERR, "USAGE: hosts purge-temp [-all-pid] [-old-pid PID] [-verbose] [-commit]\n"); 91 return FALSE; 92 } 93 65 94 int i; 66 95 for (i = 0; i < table->Nhosts; i++) { … … 68 97 char name[DVO_MAX_PATH]; 69 98 if (ALL_PID) { 70 snprintf (name, DVO_MAX_PATH, "%s/dvo.results.*.*.fits", table->hosts[i].pathname); 99 if (TEMP_TYPE == TEMP_DVO_RESULTS) snprintf (name, DVO_MAX_PATH, "%s/dvo.results.*.fits", table->hosts[i].pathname); 100 if (TEMP_TYPE == TEMP_DVO_LOG) snprintf (name, DVO_MAX_PATH, "%s/dvo.results.*.fits.log", table->hosts[i].pathname); 101 if (TEMP_TYPE == TEMP_RELPHOT_RESULTS) snprintf (name, DVO_MAX_PATH, "%s/log.rlpc.*", table->hosts[i].pathname); 102 if (TEMP_TYPE == TEMP_RELPHOT_LOG) snprintf (name, DVO_MAX_PATH, "%s/relphot.catalog.subset.dat", table->hosts[i].pathname); 71 103 } else { 72 snprintf (name, DVO_MAX_PATH, "%s/dvo.results.%05d.*.fits", table->hosts[i].pathname, PID); 104 if (TEMP_TYPE == TEMP_DVO_RESULTS) snprintf (name, DVO_MAX_PATH, "%s/dvo.results.%05d.*.fits", table->hosts[i].pathname, PID); 105 if (TEMP_TYPE == TEMP_DVO_LOG) snprintf (name, DVO_MAX_PATH, "%s/dvo.results.%05d.*.fits.log", table->hosts[i].pathname, PID); 106 if (TEMP_TYPE == TEMP_RELPHOT_RESULTS) snprintf (name, DVO_MAX_PATH, "%s/log.rlpc.*", table->hosts[i].pathname); 107 if (TEMP_TYPE == TEMP_RELPHOT_LOG) snprintf (name, DVO_MAX_PATH, "%s/relphot.catalog.subset.dat", table->hosts[i].pathname); 73 108 } 74 109 if (VERBOSE) gprint (GP_ERR, "checking %s\n", name); … … 108 143 } 109 144 110 111 112 145 gprint (GP_ERR, "error: unknown hosts command %s\n", argv[1]); 113 146 return FALSE;
Note:
See TracChangeset
for help on using the changeset viewer.
