Created
August 11, 2017 14:58
-
-
Save dorukcan/1e061f6034576085457d72cdd3d6d40c to your computer and use it in GitHub Desktop.
sql dump scripts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
powershell -noexit -executionpolicy bypass -File C:\wamp64\www\url\sqldmp_windows.ps1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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