Question: How can I modify this current python3 script to prompt user for which virtual machine they want to backup, regardless of the file name and
How can I modify this current python3 script to prompt user for which virtual machine they want to backup, regardless of the file name and where that file is stored.

# Purpose: Backs up virtual machines # | # USAGE: ./backupVM.py # | # Author: *** *** # Date: *** CURRENT DATE *** import os currentuser = os. popen('whoami') if currentuser.read() != 'root': print("You must be root") exit() else: for machine in {'centosi','centos2','centos3','al'}: print('Backing up' + machine) os.system('gzip -jramdhan/backups/' + machine + '.qcow2.gz')
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
