kokkain: (Default)
[personal profile] kokkain
Отсюда http://publishercrm.ru/sozdanie-bekapov-po-raspisaniyu-v-ms-sql-express/
1. Создаем скрипт
DECLARE @pathName NVARCHAR(512)
SET @pathName = 'D:\sql_backup\db_backup_' + Convert(varchar(8), GETDATE(), 112) + '.bak'
BACKUP DATABASE [retail83] TO  DISK = @pathName WITH NOFORMAT, NOINIT,  NAME = N'db_backup', SKIP, NOREWIND, NOUNLOAD,  STATS = 10
2. Создаем батник
sqlcmd -S SERV -U user -P pass -i D:\sql_backup\backup_retail83.sql
"C:\Program Files\7-Zip\7z.exe" a -tzip D:\sql_backup\db_backup_%date%.zip  D:\sql_backup\db_backup_*.bak
del d:\sql_backup\db_backup_*.bak

Profile

kokkain: (Default)
kokkain

April 2017

S M T W T F S
      1
2345678
9101112131415
16171819 202122
23242526272829
30      

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Sep. 26th, 2017 12:20 am
Powered by Dreamwidth Studios