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

[condor-users] condor_q -format - My favorite underused feature



It's a small thing, but I'm really fond of the "-format" option
to condor_q and condor_status.  I occasionally do some quick and
dirty shell scripting that needs to query condor_q or
condor_status and the -format option makes thinsg much easier.
If you're doing any sort of automated calls to condor_q or
condor_status you'll want to be familiar with -format.

You can find more information on -format here:
http://www.cs.wisc.edu/condor/manual/v6.6/condor_q.html#SECTION0010195000000000000000

Given -format you can do some useful one line shell scripting:

Census of jobs per user:
% condor_q -format '%8s ' Owner -format '%s\n' Cmd | sort | uniq -c
    64 adesmet /scratch/submit/a.out
     2 adesmet /home/bin/run_events
     4   smith /nfs/sim1/em2d3d
     4   smith /nfs/sim2/em2d3d

Census of systems in your pool:
% condor_status -format '%s ' Arch -format '%s\n' OpSys | sort | uniq -c
    797 INTEL LINUX
    118 INTEL WINNT50
    108 SUN4u SOLARIS28
      6 SUN4x SOLARIS28

This little ditty will return "EXISTS" if job 1234 is currently
in the queue and nothing if the job doesn't exist:

condor_q -format 'EXISTS' ClusterId 1234

-- 
Alan De Smet                              Condor Project Research
adesmet@xxxxxxxxxxx                 http://www.condorproject.org/
Condor Support Information:
http://www.cs.wisc.edu/condor/condor-support/
To Unsubscribe, send mail to majordomo@xxxxxxxxxxx with
unsubscribe condor-users <your_email_address>