2.0 KiB
2.0 KiB
Shell Scripting Solutions [📜]
This section documents my solutions to shell scripting scenarios, including automation, monitoring, and system management scripts.
Scenario Tags
| Tag | Description |
|---|---|
| [v1-S6] | Shell Scripting - Practice Scenarios v1 |
| [v2-S6] | Automation Script - Practice Scenarios v2 |
| [v3-S6] | System Automation - Practice Scenarios v3 |
Scenario: [v1-S6] Shell Scripting
Original Problem
From Practice Scenarios v1, Scenario 6: Create a script that:
- Accepts a directory path as an argument
- Finds all files larger than 100MB
- Creates a report of these files including size and last modified date
- Archives files older than 30 days into a tar.gz file
- Logs all actions to /var/log/cleanup.log
Environment
- OS Version: [To be filled]
- Initial State: [To be filled]
- Required Outcome: [To be filled]
Solution Steps
[Your solution will be added here]
Scenario: [v2-S6] Automation Script
Original Problem
From Practice Scenarios v2, Scenario 6: Create a script that:
- Monitors disk space usage
- Sends alerts when filesystems exceed 80% usage
- Automatically cleans up /tmp older than 7 days
- Generates daily system health report
- Uses getopts for command line options
Environment
- OS Version: [To be filled]
- Initial State: [To be filled]
- Required Outcome: [To be filled]
Solution Steps
[Your solution will be added here]
Scenario: [v3-S6] System Automation
Original Problem
From Practice Scenarios v3, Scenario 6: Create scripts for:
- System inventory script that:
- Lists all installed packages
- Shows disk usage
- Reports running services
- Checks SELinux status
- Backup script that:
- Uses tar with incremental backups
- Implements retention policy
- Verifies backup integrity
- Logs all operations
Environment
- OS Version: [To be filled]
- Initial State: [To be filled]
- Required Outcome: [To be filled]
Solution Steps
[Your solution will be added here]