Linux > Virtualization

For loop to execute command in all VPS

(1/1)

Jithin:
Hi Guys,

If you want to execute some commands under all VPS's under a Virtuzzo or OpenVZ node, you can use the simple for loop script given below.

for CT in $(vzlist -o ctid);do
echo "== CT $CT ==";
vzctl exec $CT <command here>;
done

Give it a try.

Navigation

[0] Message Index

Go to full version