Skip to content

Instantly share code, notes, and snippets.

@dorukcan
Created August 11, 2017 14:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dorukcan/1e061f6034576085457d72cdd3d6d40c to your computer and use it in GitHub Desktop.
Save dorukcan/1e061f6034576085457d72cdd3d6d40c to your computer and use it in GitHub Desktop.
sql dump scripts
powershell -noexit -executionpolicy bypass -File C:\wamp64\www\url\sqldmp_windows.ps1
$date = Get-Date -format dd-MM-yyyy_HH-mm-ss
$db_name = "url"
$backup_path = "C:\wamp64\www\url\storage\sqlbackups"
$filename = "$($backup_path)\$($db_name)_$($date).sql"
C:\wamp64\bin\mysql\mysql5.7.14\bin\mysqldump.exe -u root -h 127.0.0.1 url > $filename
#!/bin/bash
db_name="DB_NAME"
user="ROOT"
pass="PASS"
backup_path="/var/www/kitapfil.com/sqldump"
date=$(date +"%d-%m-%Y_%H:%M:%S")
mysqldump -u $user -p$password $db_name | gzip > $backup_path/$db_name"_"$date.gz
chmod +x $backup_path/$db_name"_"$date.gz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment