Some handy scripts: Difference between revisions
From Linix VServer
Jump to navigationJump to search
imported>Derjohn (inital creation of the page) |
imported>Glenn (spelling) |
||
| (2 intermediate revisions by 2 users not shown) | |||
| Line 25: | Line 25: | ||
</pre> | </pre> | ||
|Signature=derjohn}} | |Signature=derjohn}} | ||
[[Category:Documentation]] | |||
Latest revision as of 19:00, 21 October 2011
The motivation for creating this page was to publish some bash scripts that can be used in combination with util-vserver to make your host management simpler or more comfortable. The idea is, that you can cut&paste them from here to your shell or re-use them in your own managemnt scripts.
Show rlimits of all guests
for i in $(ls /etc/vservers/); do echo -n "$i "; if [ -e /etc/vservers/$i/rlimits ]; then for j in $(ls /etc/vservers/$i/rlimits); do echo -en "$j=$(cat /etc/vservers/$i/rlimits/$j) "; done ; fi ; echo ""; done
Creates an output like this:
guest1 as=1048576 rss=131072 guest2 guest3 as=1048576 rss=131072
derjohn
Show next free context ID
echo $(( $(sort /etc/vservers/*/context | tail -n 1) +1 ))
Creates an output like this:
666
derjohn