Skip to content

Instantly share code, notes, and snippets.

@anshultiwari1
Created August 24, 2015 23:56
Show Gist options
  • Save anshultiwari1/a1ec5c377a09ab2cd6ed to your computer and use it in GitHub Desktop.
Save anshultiwari1/a1ec5c377a09ab2cd6ed to your computer and use it in GitHub Desktop.
getting tractor tasks list with selected fields and saving them in datewise logs
#!/bin/bash
for jid in `./tq jobs "done and stoptime > -1d " -c jid,stoptime --nh | sort | awk '{print $1}'`; do echo ">>>>>>>>>>>$jid<<<<<<<<<<"; ./tq invocations "jid=$jid" -c jid,tid,wtime,current | grep -i true; echo ">>>>>>>>>>$jid<<<<<<<<<<<<<"; done | tee -a /tmp/task_stat_`date +%F`.log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment