Project

General

Profile

Создание резервной копии медиабазы данных » SQLTractBackup.cmd

Oksana Ishutina, 01/11/2022 15:37

 
@CLS
@ECHO OFF

SQLCMD -E -S YOUR_SERVER -Q "ALTER DATABASE [YOUR_DB] SET AUTO_SHRINK ON, RECOVERY SIMPLE;"
SQLCMD -E -S YOUR_SERVER -Q "BACKUP DATABASE [YOUR_DB] TO DISK='Your_disc:\the_path_to_the_file\Сustom_name_Temp.bak' WITH FORMAT, STATS=25, STOP_ON_ERROR;"

MOVE /Y Your_disc:\the_path_to_the_file\Сustom_name_5.bak Your_disc:\the_path_to_the_file\Сustom_name_6.bak
MOVE /Y Your_disc:\the_path_to_the_file\Сustom_name_4.bak Your_disc:\the_path_to_the_file\Сustom_name_5.bak
MOVE /Y Your_disc:\the_path_to_the_file\Сustom_name_3.bak Your_disc:\the_path_to_the_file\Сustom_name_4.bak
MOVE /Y Your_disc:\the_path_to_the_file\Сustom_name_2.bak Your_disc:\the_path_to_the_file\Сustom_name_3.bak
MOVE /Y Your_disc:\the_path_to_the_file\Сustom_name_1.bak Your_disc:\the_path_to_the_file\Сustom_name_2.bak
MOVE /Y Your_disc:\the_path_to_the_file\Сustom_name_0.bak Your_disc:\the_path_to_the_file\Сustom_name_1.bak
MOVE /Y Your_disc:\the_path_to_the_file\Сustom_name_Temp.bak Your_disc:\the_path_to_the_file\Сustom_name_0.bak
(6-6/7)
Add picture from clipboard (Maximum size: 742 MB)