script bat backup database mysql pada windows

Script backup database database yang akan dipanggil oleh Schedule Task

Bismillah

====
cd D:\MYSQL_BACKUP\

set TGL=per_%DATE:~0,2%_%DATE:~3,2%_%DATE:~6,4%_%TIME:~0,2%_%TIME:~3,2%.sql
echo %TGL%
echo “Proses backup Database”

mysqldump -uroot -pisipassword –database nama_db –complete-insert > %TGL%

echo “Masuk direktori 7zip”
echo “Proses compress”

C:
cd C:\Program Files (x86)\7-Zip\

7z a D:\MYSQL_BACKUP\%TGL%.zip D:\MYSQL_BACKUP\%TGL%

echo “Delete File sql”
del D:\MYSQL_BACKUP\%TGL%
====

Alhamdulillah

Published by

saifiahmada

Begin a big Process with a bit trying

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s