#!/bin/bash
DATE=$(date +%d-%m-%Y)
DB_HOST=localhost
DB_PASSWORD=pass@123
DB_NAME=mydb
mysqldump -u root -p$DB_PASSWORD -h $DB_HOST $DB_NAME > /dbbackup/db-$DATE.sql
export AWS_ACCESS_KEY_ID=ACCESS_KEY_HERE
export AWS_SECRET_KEY=SECRET_KEY_HERE
echo "Uploading db backup"
s3 cp /dbbackup/db-$DATE.sql s3://mybucket/db-$DATE.sql
0 comments:
Post a Comment