Editing ExecuteInAllVEs
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 1: | Line 1: | ||
I found myself often faced with a need to run the same command in all VEs, e.g. ''apachectl restart'' to restart all webservers or ''dmesg | tail'' to see the latest news from everybody. | I found myself often faced with a need to run the same command in all VEs, e.g. ''apachectl restart'' to restart all webservers or ''dmesg | tail'' to see the latest news from everybody. | ||
− | + | At its core is just this simple tidbit: a for loop around vzlist. | |
<code> | <code> | ||
for veid in `vzlist -Hoveid`; do vzctl exec $veid COMMAND; done | for veid in `vzlist -Hoveid`; do vzctl exec $veid COMMAND; done |