Automate a Real Backup Safely
Replace an unsafe os.system() call with subprocess.run().
A advanced Linux challenge worth 20 points. Solve it hands-on in a real Linux environment in your browser - no local setup, no fake shells.
The Challenge
Scenario: /home/labuser/lab/backup.py should compress the data folder into backup.tar.gz using the real tar command, but it uses os.system() with a broken, shell-injection-prone command string.
Task: Rewrite backup.py to use subprocess.run() with a list of arguments (no shell string) and check=True, producing backup.tar.gz containing all 3 files in data/. Run check when ready.