C

Linux › Module 6 › Lesson 5

BeginnerModule 6Lesson 5/6

Lab — Mini Automation Script

Build a backup script that copies files with a timestamp

25 min+40 XP
Module progress5 of 6

Opening

Automate something real

You will write a script that backs up a folder into archive/ with today's date in the name. Small scripts like this are how teams automate log collection and config backups.

1. Setup

cd ~/cyberlium-lab mkdir -p project archive echo "important data" > project/notes.txt

2. Write backup.sh

nano backup.sh #!/bin/bash STAMP=\$(date +%Y-%m-%d) cp -r project "archive/project-\$STAMP" echo "Backup saved to archive/project-\$STAMP" ls -l archive/

3. Run It

chmod +x backup.sh ./backup.sh Run twice on different days—or change STAMP to include time—and see multiple archives.

Complete Automation Lab

Create backup.sh, make it executable, run it, and confirm archive/project-DATE exists with notes.txt inside.

← Previous