Recall & Review
beginner
What is the main purpose of a backup automation script?
To automatically copy important files or folders to a safe location regularly, so data is protected against loss.
Click to reveal answer
beginner
In a bash backup script, what command is commonly used to copy files and directories?
The
rsync command is commonly used because it efficiently copies and synchronizes files and directories.Click to reveal answer
intermediate
Why is it important to check if the backup destination directory exists in a script?
To avoid errors during backup, the script should check if the destination folder exists and create it if it does not.
Click to reveal answer
intermediate
What does the following bash snippet do? <br>
if [ ! -d "$backup_dir" ]; then mkdir -p "$backup_dir"; fi
It checks if the directory stored in
$backup_dir does not exist, and if so, creates it including any needed parent directories.Click to reveal answer
beginner
How can you schedule a backup automation script to run daily on a Linux system?
You can use
cron to schedule the script. Adding a cron job with crontab -e lets you run the script at set times automatically.Click to reveal answer
Which command is best for syncing files in a backup script?
✗ Incorrect
rsync efficiently copies and syncs files, making it ideal for backups.
What does the
-p option do in mkdir -p?✗ Incorrect
-p creates parent directories if they don't exist, preventing errors.
Why should a backup script check if the destination folder exists?
✗ Incorrect
Checking prevents errors if the folder is missing, ensuring backup success.
Which tool schedules scripts to run automatically on Linux?
✗ Incorrect
cron runs scripts at scheduled times automatically.
What is a safe place to store backup files?
✗ Incorrect
Storing backups on a separate drive protects data if the main drive fails.
Explain how a simple bash backup automation script works.
Think about the steps to safely copy files regularly.
You got /4 concepts.
Describe how to schedule a backup script to run every day at 2 AM using cron.
Focus on the cron time format and command.
You got /4 concepts.