VPS Update Script

Python script to update VEs using vzctl.

The contents of vps-backpy

#!/usr/bin/python
#
# Update packages in VE container
#
# Version 0.4

from os import system

container = ['xxx',]

for id in container:
version = 'vzctl exec ' + id + ' cat /etc/debian_version'
update = 'vzctl exec ' + id + ' apt-get update'
upgrade = 'vzctl exec ' + id + ' apt-get upgrade -y'

print '\nDebian Version in vps-' + id
system(version)

print '\nUpdate package list for vps-' + id
system(update)

print '\nUpgrade vps-' + id
system(upgrade)

print '\nUpgraded...\n'
for id in container:
print 'vps-' + id