I want to create database backup on daily bases using cron job.
I have created one batch file for database backup. Below is batch file code.
#!/bin/bash
SQLDUMP="$(date +'%Y%m%d%H%M').sql.gz"
echo "Creating backup of database to $SQLDUMP"
mysqldump --host 'myhost.com' -u 'root' -p 'password' --databases 'test' | gzip -9 > $SQLDUMP
echo "Dump Zipped up"
echo "Uploading zipped dump to the Amazon S3 bucket…"
s3cmd put $BACKUPNAME s3://example.com/dbbackup/$BACKUPNAME
echo "Removing the backup file $SQLDUMP"
rm $BACKUPNAME
echo "Done"
But database backup not storage on S3.
File Path : var/app/current/app/sqlbackup.sh
Set for 5 hrs in Crontab : * 5 * * * /bin/sh /var/app/current/app/sqlbackup.sh
bash
frombatch-file
. – sohaib Sep 19 '17 at 14:12aws configure
from the cli and set up your ssh user to have access to S3? – McRed Sep 19 '17 at 14:32