📖 Scenario: You are working as a technician managing a SCADA system that controls a water treatment plant. To ensure safety and reliability, you need to create a simple backup strategy for the system's configuration data.
🎯 Goal: Build a basic backup script that stores system configuration data, sets a backup frequency, selects critical files, and outputs the backup status.
📋 What You'll Learn
Create a dictionary called config_data with exact keys and values for system settings
Add a variable called backup_frequency with the value 'daily'
Create a list called critical_files containing exact filenames to backup
Print the backup summary showing frequency and files backed up
💡 Why This Matters
🌍 Real World
Backup strategies are essential in SCADA systems to prevent data loss and ensure system reliability in critical infrastructure like water treatment plants.
💼 Career
Understanding how to manage backups and configuration data is a key skill for SCADA system technicians and DevOps engineers working in industrial automation.
Progress0 / 4 steps
1
Create system configuration data
Create a dictionary called config_data with these exact entries: 'ip_address': '192.168.1.100', 'port': 502, 'protocol': 'Modbus', 'timeout': 30
SCADA systems
Hint
Use curly braces {} to create a dictionary with key-value pairs.
2
Set backup frequency
Add a variable called backup_frequency and set it to the string 'daily'
SCADA systems
Hint
Assign the string 'daily' to the variable backup_frequency.
3
Select critical files for backup
Create a list called critical_files containing these exact filenames: 'config.xml', 'system.log', 'network.cfg'
SCADA systems
Hint
Use square brackets [] to create a list with the given filenames as strings.
4
Print backup summary
Write a print statement that outputs: "Backup frequency: daily" and another print statement that outputs: "Files backed up: config.xml, system.log, network.cfg"
SCADA systems
Hint
Use print with f-strings and join to format the output exactly.
Practice
(1/5)
1. What is the main purpose of creating system backups in SCADA systems?
easy
A. To save copies of important data to prevent loss
B. To speed up the system performance
C. To increase the number of users
D. To reduce the power consumption
Solution
Step 1: Understand the role of backups
Backups are copies of data saved to protect against data loss.
Step 2: Identify the main goal in SCADA context
In SCADA systems, backups prevent loss of critical control data and configurations.
Final Answer:
To save copies of important data to prevent loss -> Option A
Quick Check:
Backup purpose = prevent data loss [OK]
Hint: Backups protect data from loss or damage [OK]
Common Mistakes:
Thinking backups improve speed
Confusing backups with user management
Assuming backups reduce power use
2. Which command syntax correctly creates a compressed backup archive of the /etc/scada directory using tar?
easy
A. tar -cfz /etc/scada backup.tar.gz
B. tar -xf backup.tar.gz /etc/scada
C. tar -cz /etc/scada backup.tar.gz
D. tar -czf backup.tar.gz /etc/scada
Solution
Step 1: Understand tar options
-c creates archive, -z compresses with gzip, -f specifies filename.
Step 2: Match correct order and options
tar -czf backup.tar.gz /etc/scada uses correct order: tar -czf backup.tar.gz /etc/scada
Final Answer:
tar -czf backup.tar.gz /etc/scada -> Option D
Quick Check:
Correct tar syntax = -czf [OK]
Hint: Use -czf to create compressed tar archive [OK]
Common Mistakes:
Using -xf which extracts instead of creates
Wrong option order like -cfz
Placing filename after directory incorrectly
3. Given the command rsync -av /scada/data/ /backup/scada_data/, what will be the result?
medium
A. It deletes all files in /backup/scada_data
B. It copies all files from /scada/data to /backup/scada_data preserving attributes
C. It compresses files in /scada/data into a zip archive
D. It moves files from /backup/scada_data to /scada/data
Solution
Step 1: Understand rsync options
-a means archive mode (preserves attributes), -v means verbose output.
Step 2: Analyze source and destination paths
Command copies files from /scada/data/ to /backup/scada_data/ preserving file info.
Final Answer:
It copies all files from /scada/data to /backup/scada_data preserving attributes -> Option B
Quick Check:
rsync -av copies with attributes [OK]
Hint: rsync -av copies files with attributes [OK]
Common Mistakes:
Confusing rsync with delete command
Thinking it compresses files
Mixing source and destination paths
4. You run tar -czf backup.tar.gz /scada/config but the backup file is empty. What is the likely cause?
medium
A. The /scada/config directory does not exist or is empty
B. The tar command syntax is incorrect
C. The backup file is corrupted after creation
D. The system lacks gzip compression support
Solution
Step 1: Check directory existence
If /scada/config does not exist or is empty, tar creates an empty archive.
Step 2: Verify command syntax and system support
Command syntax is correct and gzip is standard; corruption unlikely immediately after creation.
Final Answer:
The /scada/config directory does not exist or is empty -> Option A
Quick Check:
Empty archive = missing or empty source directory [OK]
Hint: Check source directory exists and has files [OK]
Common Mistakes:
Assuming syntax error without checking directory
Blaming gzip support without evidence
Ignoring possibility of empty source
5. You want to automate daily backups of SCADA system data to a remote server using rsync over SSH. Which command correctly achieves this?
hard
A. tar -czf /backup/scada_data.tar.gz /scada/data/
B. rsync -av /scada/data/ /backup/scada_data/
C. rsync -avz -e ssh /scada/data/ user@remote:/backup/scada_data/
D. scp /scada/data/ user@remote:/backup/scada_data/
Solution
Step 1: Identify remote backup with encryption
rsync with -e ssh uses SSH for secure remote transfer.
Step 2: Confirm options for compression and archive
-a for archive, -v for verbose, -z for compression; source and remote destination are correct.
Final Answer:
rsync -avz -e ssh /scada/data/ user@remote:/backup/scada_data/ -> Option C