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

Re: [Condor-users] condor_status with -format options


> Are there any limitations as to the number of fields for condor_status 
> that can be specified using the format option?
> example:
> #> /opt/condor/bin/condor_status -format "%s" Name -format "%s" OpSys 
> -format "%s"  Arch -format "%s" State -format "%s\n" Activity
> this returns the values fine.

I'm not sure how you define "fine" since you have no delimeters between
the output fields.  You want something like this:

/opt/condor/bin/condor_status -format "%s " Name -format "%s " OpSys -format "%s " Arch -format "%s " State -format "%s\n" Activity

> #> /opt/condor/bin/condor_status -format "%s" Name -format "%s" OpSys 
> -format "%s"  Arch -format "%s" State -format "%s" Activity -format 
> "%s\n" Mem
> This does not.  It ignores the last format option completely no matter 
> what field I specify.  It appears that you can specify a maximum of 5 
> columns for condor_status.  Is this true?  Am I doing something wrong?

In this case "Mem" is not a valid field so nothing is printed for that
particular field, but you still should have gotten one long string that
contained all of the other fields one after the other.  You want this:

/opt/condor/bin/condor_status -format "%s " Name -format "%s " OpSys -format "%s " Arch -format "%s " State -format "%s " Activity -format "%s\n" Memory

One of the features of condor_status is that if a field name is not
valid then nothing is printed for that field, with the additional
feature that if there is no "%" conversion in the format string then
the format string is printed regardless of the field name.  So you can
ensure there is always a trailing carriage return like this:

/opt/condor/bin/condor_status -format "%s " Name -format "%s" RemoteUser -format "\n" AnyString

This is useful since RemoteUser may or may not be defined depending on
the machine state.

I don't know of any limits to the number of format options beyond the
system limit to the number of characters in your command line.

Daniel K. Forrest	Laboratory for Molecular and
forrest@xxxxxxxxxxxxx	Computational Genomics
(608) 262 - 9479	University of Wisconsin, Madison