This project automates backing up a local directory using Bash. It compresses the directory, stores the archive locally, uploads it to an AWS S3 bucket, and uses cron to automate the process every 2 minutes. All steps are documented with screenshots.
The following diagram shows the structure and flow of the backup process, including local compression, S3 upload, and automation using cron.
. ├── scripts/ │ ├── backup-local.sh │ ├── backup-to-s3.sh ├── screenshots/ │ ├── 01-first-script.png │ ├── ... ├── Project Architecture/ │ ├── project-cover.png │ ├── project-diagram.png ├── README.md
A basic Bash script to compress a local directory into a .tar.gz archive.
- Run without argument (error)
- Run with valid directory: creates archive and log file
bash aws s3 mb s3://your-bucket-name
A Bash script that compresses the folder and uploads the archive to S3.
bash */2 * * * * ec2-user /home/ec2-user/scripts/backup-to-s3.sh
bash aws s3 rb s3://your-bucket-name --force
- Tested on Amazon Linux EC2 with AWS CLI v2
- Make sure the IAM Role has correct permissions
- Cronjob runs every 2 minutes (customizable)
- All logs saved to backup.log
This project is licensed under the MIT License - see the LICENSE file for details.

























