[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [HTCondor-users] How to get CMD classad on condor_q -format output without the fullpath of the job command



On 09/11/2013 11:09 AM, kschwarz@xxxxxxxxxxxxxx wrote:
Hi,

I am running Condor on Windows machines and want to get the CMD classad output for each job in the queue, without the fullpath of the job command.

c:\TEMP>condor_q -f "%6d." ClusterId -f "%-6d " ProcId -f "%-s\n" Cmd
  9673.0      C:\_ANDRE\01_SIMULACAO\_FSIML_armonizacao\00_validacao\LIM\17_rudder_maneuver\caso_e_a01_m5j_550-h1a_condor.bat
  9680.0      C:\_ANDRE\01_SIMULACAO\_FSIML_armonizacao\00_validacao\LIM\17_rudder_maneuver\caso_e_a02_m3a_550-h1a_condor.bat

c:\TEMP>

So the answer should be something like:

  9673.0      caso_e_a01_m5j_550-h1a_condor.bat
  9680.0      caso_e_a02_m3a_550-h1a_condor.bat

How could this be done?

It is a little tricky, but you can use the classad regexps function to remove the directory prefix, something like (on Unix), with a regexp that says "Match the longest string of characters without a / at the end of the string.

condor_q  -format "%d." Clusterid -format "%d " Procid -format "%s\n" 'regexps("([^\/]*$)", Cmd, "\1")'

I think the Windows quoting rules are a bit different, and you probably want to avoid both / and \, so something this should work there:

condor_q  -format "%d." Clusterid -format "%d " Procid -format "%s\n" regexps(\"([^/\\]*$)\", Cmd, \"\1\")'

-Greg