RS Scripter to regular back up rdl files

Use RS Scripter to regular back up rdl files

Download file from
http://www.sqldbatips.com/showarticle.asp?ID=62

Create the following Catalog.xml file and save it to your RS Scripter folder, recursive indicates subfolders should also be backed up

<?xml version=”1.0″ ?>
<RSCatalog>
<CatalogItems>
<CatalogItem Path=”/Folder1″ Recursive=”True” />
<CatalogItem Path=”/Folder2″ Recursive=”True” />
<CatalogItem Path=”/Folder3″ Recursive=”True” />
</CatalogItems>
<Roles />
<Schedules />
</RSCatalog>
Run the back up with the following tsql

/*remove back up directory*/
EXEC(‘xp_cmdshell ”rmdir /s /q “C:\Folder\Folder””’)

/*back up rdls*/
EXEC(‘xp_cmdshell ””C:\RS Scripter\rsscriptercmd.exe”
/s:http://SERVERNAME/ReportServer/ReportService2005.asmx
/o:C:\Folder\Folder”’)

/*if its the first of the month create a historic back up folder*/
if day(GETDATE()) = 1
BEGIN
declare @arc_dir varchar(6)=left(convert(varchar(10),getdate(),112),6)
exec( ‘xp_cmdshell ”Xcopy /E /I /Y C:\Folder\Folder
C:\RDL_Archive\’+@arc_dir+””)
END

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: