Open main menu

CDOT Wiki β

Changes

OPS245 Lab 2

19 bytes added, 10:42, 24 January 2021
INVESTIGATION 4: USING PYTHON TO AUTOMATE MANAGING VIRTUAL MACHINES
&nbsp;&nbsp;for machine in {'centos1','centos2','centos3'}:<br />
&nbsp;&nbsp;&nbsp;&nbsp;print('Backing up' + machine)<br />
&nbsp;&nbsp;&nbsp;&nbsp;os.system('gzip < /var/lib/libvirt/images/' + machine + '.qcow2 > ~YourRegularUsername/backups/' + machine + '.qcow2.gz')<br />
</code>
572
edits