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

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

Thank you for your response. I fixed most of the problems by following your example and looking at the Class Ads (using the -verbose flag). I do have one other question. ActivityTime does not appear in the Class Ads, so it is ignored when I try to use the format flag with that field. How do I "format" this field?

Thanks again,

Anthony Tiradani

Daniel Forrest wrote:
Kewley, J (John) wrote:
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.
It used to be the case that AnyString had to match a proper ClassAd
Otherwise nothing was printed. If this has changed then it is likely to
be in 6.9 only.

It has been this way since 6.6.8, I just checked the release notes.

In fact, this is the example they give:

For example, to print out the machine's Name (always defined) and the
RemoteUser (only defined if the machine is claimed), and always print a
newline (to keep the formatting legible), this command will now work:

% condor_status -f "%s " Name -f "%s " RemoteUser -f "\n" bogus

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature