Created
April 8, 2016 12:37
-
-
Save halityurttas/26329b1b638c905b85431a71c1cd3f99 to your computer and use it in GitHub Desktop.
Windows ortamında mysql full yedekleme
This file contains hidden or 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
@ECHO OFF | |
Rem -- dizinler örnektir lütfen kendi mysql dizininizi belirtin burada wamp için örnekleme yaptım. Bu noktaya dikkat | |
C:\wamp\bin\mysql\mysql5.6.17\bin\mysqldump -u root --all-databases > "C:\mysqlbackups\tmp\alldb.sql" | |
Rem -- 7z indirip 7z.exe 7z.dll 7z-zip.dll 7z-zip32.dll yi de bu klasöre atın. ayrıca klasöre tmp adında bir klasör açmayı unutmayın | |
Rem -- ilk dizin adresi kaydedilecek yer ikincisi yukarıda dump sql i aktardığımız dosya adresi | |
7z a -tzip "C:\mysqlbackups\dest\mysql_alldatabase_%DATE:~7,2%.%DATE:~4,2%.%DATE:~-4%_backup.zip" "C:\mysqlbackups\tmp\*.*" -mx5 | |
Rem -- forfiles ile -d 3 yaparak 3 gün öncesinde ki dosyaları bulmuş oluyoruz bununla 3 gün öncesinde ki yedekleri sileceğiz kendinize göre ayarlayabilirsiniz | |
forfiles -p "C:\mysqlbackups\dest" -s -m *.* -d 3 -c "cmd /c del @path" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment