chmod 700 mongodb-installer.sh
./setup_mongo.sh
sudo apt install unzip
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install
aws configure
aws s3 mb s3://<your-bucket-name>
sudo apt-get update
Install mongodb-database-tools
. This package includes essential tools like mongodump
and mongorestore
.
sudo apt install mongodb-database-tools
- Go to the IAM Console in AWS.
- Create an IAM role with the following permissions:
AmazonS3FullAccess
(or a custom policy granting permission to upload to your specific S3 bucket).
- Attach the IAM role to your EC2 instance.
aws s3 ls s3://your-bucket-name
sudo chmod 700 backup-generator.sh
sudo ./backup-generator.sh
*/2 * * * * /path/to/backup-generator.sh >> /var/log/backup-generator.log 2>&1
grep CRON /var/log/syslog