Skip to content

Instantly share code, notes, and snippets.

@jorgecasas
Last active May 4, 2016 09:48
Show Gist options
  • Select an option

  • Save jorgecasas/73c5ac52a467c601c67cbba0a8639c3c to your computer and use it in GitHub Desktop.

Select an option

Save jorgecasas/73c5ac52a467c601c67cbba0a8639c3c to your computer and use it in GitHub Desktop.
Gearman jobs monitoring using console
#!/bin/bash
# Get args.
reload=false
while [ "$1" != "" ]; do
case $1 in
-r | --reload ) reload=true
;;
-h | --help ) echo ""
echo "Usage: gearman-jobs.sh [ [-r] | [-h] ]"
echo "Options: "
echo " -r | --reload: Reload jobs queue. Press CTRL+C to exit."
echo " -h | --help: This help."
echo ""
exit
esac
shift
done
echo "Gearman jobs "
if [ "$reload" = "true" ]; then
watch "gearadmin --status | sort -n | column -t"
else
gearadmin --status | sort -n | column -t
fi
echo ""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment