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

Re: [Condor-users] format for timestamps with condor_q -format?



oops - printf not sprintf if you want any output...

On 3/8/06, Matt Hope <matthew.hope@xxxxxxxxx> wrote some rubbish he
really should have tried in a shell first:
> awk: (gawk to be precise - not tested on anything else) the example
> shows bash input but you could get it any other way you like
>
> condor_q ${OPTIONS} \
> -format "%d|" ClusterId \
> -format "%d|" ProcId \
> -format "%s|" Owner \
> -format "%d|" QDate \
> -format "%d|" EnteredCurrentStatus \
> -format "%d|" ServerTime \
> -format "%d|" JobStatus \
> -format "%d|" JobPrio
> -format "?%d\n" ClusterId | awk '
> BEGIN {
>        FS = "|";
> }
> {
>        ClusterId = $1 ;
>        ProcId = $2;
>        JobId = ClusterId "." ProcId;
>        Owner = $3;
>        QDate = $4;
>        EnteredCurrentStatus = $5;
>        ServerTime = $6;
>        JobStatus = $7;
>        JobPrio = $8;
>
>        # these are assuming all previous execution runs were useless
>        RunTime = strftime("%H:%M:%S", ServerTime - EnteredCurrentStatus);
>        RunDays = (ServerTime - EnteredCurrentStatus) / 86400;
>        sprintf("%-9s %1d+%s %-2d\n",
>                JobId,
>                RunDays,
>                RunTime,
>                JobPrio);
> }
> '
>
> Matt
>