DEV Community

Cover image for Q Backup Manager: A Modular Bash Backup Script Powered by Amazon Q Developer
Purushotam Adhikari
Purushotam Adhikari

Posted on

Q Backup Manager: A Modular Bash Backup Script Powered by Amazon Q Developer

This is a submission for the Amazon Q Developer "Quack The Code" Challenge: Crushing the Command Line

What I Built

I built a modular, automated backup script in Bash called Q Backup Manager that allows developers and sysadmins to back up important files and directories easily and efficiently. This script includes:

  • Configurable source and destination paths
  • Dry-run mode to preview the backup process
  • Color-coded logging for easy readability
  • Optional cron integration for scheduled backups
  • Built with Amazon Q Developer CLI as a coding companion

It solves the common problem of forgetting to back up configuration files, codebases, or logs during fast-paced development — especially in environments where GUIs are unavailable (e.g., WSL, servers, containers).

Demo

Here are a few screenshots showcasing the tool in action:

🔧 Dry Run Example

Dry Rum of the script

Backup Success

A full backup performed by the script

To test the script locally:

git clone https://github.com/Puru54/q-backup-manager.git
cd q-backup-manager
chmod +x backup.sh
./backup.sh --dry-run
Enter fullscreen mode Exit fullscreen mode

Code Repository

🔗 GitHub Repo: https://github.com/Puru54/q-backup-manager

Contains:

  • backup.sh: the main Bash script
  • README.md: usage, features, and setup instructions
  • screenshots/: demo images for documentation and presentation

How I Used Amazon Q Developer

Amazon Q Developer acted as my AI pair programmer during the creation of this tool. Here's how I used it:

  1. Script Review & Optimization

    I asked Q to analyze my backup.sh file. It offered valuable recommendations:

    • Refactor the script into logical functions
    • Add modular logging
    • Improve error handling
  2. Debugging Logic

    Amazon Q helped identify a subtle issue in the dry-run mode and suggested a more reliable way to structure the rsync flags.

“I asked Q to optimize my backup logic for modularity and logging — and it delivered.”

Conclusion

This project makes my day-to-day development work much smoother by ensuring my local and server files are backed up reliably. The Amazon Q Developer CLI didn’t just speed up development — it taught me best practices in shell scripting along the way.


Check it out: https://github.com/Puru54/q-backup-manager

Built with the help of Amazon Q Developer

Challenge: Crushing the Command Line

Top comments (2)

Collapse
 
sibasis_padhi profile image
Sibasis Padhi

Great , simple tool. Over the time, when backup file grows, any thing you have thought about it?

Collapse
 
caffinecoder54 profile image
Purushotam Adhikari

We could add a retention policy to automatically remove older backups and using incremental backups with rsync to avoid duplicating unchanged files.

We could also compress backups to save space and let users exclude bulky folders like node_modules. These improvements would keep the backup system efficient as data grows.