How to create mirrored backups by LiteSpeed Maintenance Plan
Option not available via the GUI Maintenance Plan wizard
Create a new LiteSpeed maintenance plan (using the GUI Add Maintenance Plan Wizard) and for the Task, chose SQL and simply add the script:
DECLARE
@Now CHAR(14), -- current date in the form of yyyymmddhhmmss
@DBName SYSNAME, -- stores the database name that is currently being processed
@cmd SYSNAME, -- stores the dynamically created DOS command
@Strfilename VARCHAR(200), -- stores the path and file name of the bkp file
@Strmirrorfilename VARCHAR(200), -- stores the path and file name of the bkp file
@path VarChar(512)
Set @path = 'D:\backup\'
Set @DBName = 'Northwind'
Set @Now = REPLACE(REPLACE(REPLACE(CONVERT(VARCHAR(50), GETDATE(), 120),
'-', ''), ' ', ''), ':', '')
Set @Strfilename = @Path + '\' + @DBName + '_LS_Full_' + @Now + '.bkp'
Set @Strmirrorfilename = @Path + '\' + @DBName + '_LS_Full_mirror_' + @Now + '.bkp'
exec master.dbo.xp_backup_database @database = @DBName
, @filename = @StrfileName
, @backupname = 'Northwind'
, @desc = 'Backup of Northwind'
, @mirror = @Strmirrorfilename
, @logging = 3
Mirrored backups in LiteSpeed are only available beginning with version 4.6x
© ALL RIGHTS RESERVED. Terms of Use Privacy Cookie Preference Center