Skip to content

Instantly share code, notes, and snippets.

@Gpzim98
Created September 28, 2017 09:53
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save Gpzim98/54972dfbadd022391a4e8c428615844d to your computer and use it in GitHub Desktop.
# Mysql DUMP
#!/bin/bash
user="user"
password="pass"
host="localhost:port"
db_name="db_name"
backup_path="/home/ubuntu/path/"
date=$(date +"%d-%b-%Y")
# Set default file permissions
umask 177
mysqldump -u $user $password -h $host $db_name > $backup_path/$db_name-$date.sql
# Get current date formated
date=$(date +"%d-%b-%Y")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment