Run an command on all virtuozzo containers on a node

December 11th, 2015 by admin Leave a reply »

The following script will run a command on all containers on a virtuozzo node.

for i in `cat /proc/vz/veinfo | awk '{print $1}'|egrep -v '^0$'`; \
do echo "Container $i"; vzctl exec $i COMMANDTORUNGOESHERE; done
if you found this helpful feel free to donate to:
ZEC: t1NQp1UuqQbmnXzazbLTSreS2AbaZpRBuTM
LTC: LZyNF1qkBUA7XFz83m5xwzGgmmj1owQn9d
BTC: 1PY95KFPTEJTR7f2NnSgaB6xB9pwDJkcJz
Advertisement

Leave a Reply

You must be logged in to post a comment.