Broadcast Radio Forums

SQL Backup Script


http://forums.broadcastradio.com/Topic8583.aspx

By John-Michael Sugden - Monday, July 4, 2016 11:39:50 AM

Hello All,

A couple of years ago I created a batch/SQL script to backup databases from an SQL instance from a scheduled task. This script has been updated over the years so I am republishing my current version for use here.
--------------------------------------------------------------------------------------------
To use this Script:

Warning: This script is used at your own risk! If you are unsure of the procedure please contact P Squared \ Broadcast Radio Technical Support for assistance.

Note: This script can only be run on the machine running the SQL Server Instance. This script will not create backups from a client machine.

* Extract the folder "SQL Backup" from the zip file to where you want the backups. (Our Default is: D:\Psquared\SQL Backup)
* In the "SQL Backup\Scripts" folder edit SQLBackup.bat and set the backup directory to the appropriate folder. (Our Default is: D:\Psquared\SQL Backup)
* Set the Number of Days worth of backups you would like to keep. (Our Default is 7)
* Save and close the file.
* Create a scheduled task to run SQLBackup.bat every day as an administrator.

I recommend you test the back by running the scheduled task and checking that backups turn up in the SQL Backup\Backups Directory. You should find a dated folder and a 'Current' folder containing the backups.
--------------------------------------------------------------------------------------------
Hope this helps,

John-Michael Smile