Skip to content

Instantly share code, notes, and snippets.

@nisaacson
Created August 14, 2014 19:04
Show Gist options
  • Save nisaacson/2cbec9f441acb88e2bcb to your computer and use it in GitHub Desktop.
Save nisaacson/2cbec9f441acb88e2bcb to your computer and use it in GitHub Desktop.
Get the status of all jobs from the kue api
#!/usr/bin/env bash
KUE_URL="http://localhost:9090/jobs"
DATE=$(date +"%Y-%m-%d")
FOLDER="kue-status_$DATE"
function get_status {
STATUS=$1
STATUS_URL="$KUE_URL/$STATUS/0..9999"
FILE_PATH="$FOLDER/$STATUS.json"
echo "getting jobs from kue at url: $STATUS_URL"
curl --silent $STATUS_URL > $FILE_PATH
echo
}
mkdir $FOLDER
get_status "inactive"
get_status "active"
get_status "complete"
get_status "failed"
ZIP_FILE="$FOLDER.zip"
echo "compressing folder $FOLDER to zip file $ZIP_FILE"
zip -r $ZIP_FILE $FOLDER
echo
rm -r $FOLDER
echo "wrote kue status to $ZIP_FILE"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment