Last active
August 29, 2015 14:04
-
-
Save yahuarkuntur/db55bb742e4957c6d0f3 to your computer and use it in GitHub Desktop.
Bash script to delete all RabbitMQ queues from a text file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.