Skip to content

Instantly share code, notes, and snippets.

@yahuarkuntur
Last active August 29, 2015 14:04
Show Gist options
  • Save yahuarkuntur/db55bb742e4957c6d0f3 to your computer and use it in GitHub Desktop.
Save yahuarkuntur/db55bb742e4957c6d0f3 to your computer and use it in GitHub Desktop.
Bash script to delete all RabbitMQ queues from a text file
#!/bin/bash
FILENAME=$@
if [ ! -f $FILENAME ]; then
echo "File $FILENAME not found!"
exit 1
fi
while read line; do
./rabbitmqadmin delete queue name="$line"
done < $FILENAME
@yahuarkuntur
Copy link
Author

Example:
sudo sh delete_queues.sh queues.txt
Requires rabbitmqadmin in path and the text file with the list of queues.

The list of queues can be created like this:
sudo rabbitmqctl list_queues name > queues.txt
then remove the first and last line.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment