Backup automation script
📖 Scenario: You work as a system assistant and want to automate backing up important files from a folder to a backup location. This helps keep your data safe without manual copying every time.
🎯 Goal: Create a bash script that copies files from a source directory to a backup directory, only backing up files larger than a certain size.
📋 What You'll Learn
Create a variable for the source directory with the exact path
/home/user/documentsCreate a variable for the backup directory with the exact path
/home/user/backupCreate a variable called
min_size with the value 1000 (bytes)Use a
for loop to check each file in the source directoryCopy only files larger than
min_size to the backup directoryPrint the name of each file copied
💡 Why This Matters
🌍 Real World
Automating backups saves time and prevents data loss by regularly copying important files without manual effort.
💼 Career
System administrators and IT support staff often write scripts like this to maintain data safety and automate routine tasks.
Progress0 / 4 steps