Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This batch file is an example of Questions 17 20 pose questions from the following Windows batch file. set dbUser=root set dbPassword=password set backupDir=C:Documents and

This batch file is an example of Questions 17 20 pose questions from the following Windows batch file. set dbUser=root set dbPassword=password set backupDir="C:\Documents and Settings\user\Desktop\backup\mysql" set mysqldump="C:\Program Files\MySQL\MySQL Workbench 5.2 CE\mysqldump.exe" set mysqlDataDir="C:\Documents and Settings\All Users\Application Data\MySQL\MySQL Server 5.1\data" set zip="C:\Program Files\7-Zip\7z.exe" : get date for /F "tokens=1-3 delims=- " %%i in ('date /t') do ( set yy=%%i set mon=%%j set dd=%%k ) :: get time for /F "tokens=5-8 delims=:. " %%i in ('echo.^| time ^| find "current" ') do ( set hh=%%i set min=%%j ) echo dirName=%yy%%mon%%dd%_%hh%%min% :: switch to the "data" folder pushd %mysqlDataDir% :: iterate over the folder structure in the "data" folder to get the databases for /d %%f in (*) do ( if not exist %backupDir%\%dirName%\ ( mkdir %backupDir%\%dirName% ) %mysqldump% --host="localhost" --user=%dbUser% --single-transaction --add-drop-table --databases %%f > %backupDir%\%dirName%\%%f.sql %zip% a -tzip %backupDir%\%dirName%\%%f.sql.gz %backupDir%\%dirName%\%%f.sql del %backupDir%\%dirName%\%%f.sql ) popd

a a physical backup only

b a physical backup and a restore

c a scheduled backup

d a general backup script that can run on any operating system

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle RMAN For Absolute Beginners

Authors: Darl Kuhn

1st Edition

1484207637, 9781484207635

More Books

Students also viewed these Databases questions

Question

Can the readability be improved?

Answered: 1 week ago