About remote backup of SQL database (3)

Using batch processing and windows task planning to perform remote backups to achieve database disaster recovery is to copy the files you backed up on this machine to another machine.

The batch content is:

 xcopy /d/e/c/i/h/r "x:\*.*" "w:\*.*"
rem It well ignore the same files.
rem /d copy the new date files
rem /e copy the folder subfolder inclue the empty folder
rem /c copy continue even error
rem /i set all target are the files
rem /h copy the hide files
rem /r overwrite read-only files
pause

Remarks: X: \: the directory where the backup file is located for you

           W: \: Save as Bat suffix for the target directory that you need to copy, that is, the address mapped from other servers (the name is best not to use Chinese name).

The Rem part is just some instructions, it is useless.

Let's create a windows task plan

step1: Create a windows task plan

step2: set trigger

step3: Select the batch to be executed

After the relevant settings are completed, save it, and the scheduled operation will copy the backup file to the specified machine at the time set by your trigger. Of course, it is best to make a separate copy for SQL maintenance plan. Backup plan (only keep the latest day) to avoid duplicate copy.

Published 22 original articles · praised 7 · 100,000+ views

Guess you like

Origin blog.csdn.net/qyx0714/article/details/70859534