Skip to content

Instantly share code, notes, and snippets.

@ceelsoin
Last active June 25, 2020 18:06
Show Gist options
  • Save ceelsoin/d83550ddf50cf54705225e8feae9e73b to your computer and use it in GitHub Desktop.
Save ceelsoin/d83550ddf50cf54705225e8feae9e73b to your computer and use it in GitHub Desktop.
#!/bin/bash
#Backup_Directory_Locations
BACKUPROOT="/var/www/backups_diarios"
TSTAMP=$(date +"%d-%b-%Y-%H:%M")
S3BUCKET="approvedemailplatformsso-${domain}"
TSTAMP=$(date +"%d-%b-%Y-%H:%M")
zip -r /var/www/backups_diarios/$TSTAMP.html.zip /var/www/html/
# Move file from server to your S3 bucket
aws s3 mv /var/www/backups_diarios/$TSTAMP.html.zip s3://$S3BUCKET/
#!/bin/bash
# Database credentials
USER="root"
PASSWORD="dhy42imb"
HOST="localhost"
DB_NAME="mautic"
#Backup_Directory_Locations
BACKUPROOT="/var/www/backups_diarios"
TSTAMP=$(date +"%d-%b-%Y-%H:%M")
S3BUCKET="approvedemailplatformsso-${domain}"
mysqldump -h$HOST -u$USER $DB_NAME -p$PASSWORD | gzip -9 > $BACKUPROOT/$DB_NAME-$TSTAMP.sql.gz
# Move file from server to your S3 bucket
aws s3 mv $BACKUPROOT/$DB_NAME-$TSTAMP.sql.gz s3://$S3BUCKET/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment