Archive for the ‘ps script for backups’ Tag

Powershell script to manipulate SQL Server backup files   Leave a comment

Scenario

I use Ola Hallengren’s famous backup solution to back up my SQL Server databases. The destination for full backups is a directory on local disk; let’s say D:\SQLBackup\

If you are familiar with Ola’s backup scripts, you know the full path for backup file looks something like:

D:\SQLBackup\InstanceName\DatabaseName\FULL\InstanceName_DatabaseName_FULL_yyyymmdd_hhmiss.bak

where InstanceName is a placeholder for the name of the SQL server instance, similarly, DatabaseName is for the Database Name. Read the rest of this entry »