Altiris Database Backup with Date/Time Stamp in File Name
A couple of weeks ago I was looking at the backup options on our SQL servers and noticed that we didn't have very good backups of our Altiris database. I wanted to have a backup taken multiple times throught out the day with the date and timestamp in the filename so I had an easy way to know where to go back to.
I started playing with scripting this and came up with something that works well. Basically, I am just defining a variable and having that variable be the location where I want the backup to be written, plus have it concatenate the date/time stamp on the end of the filename. Then I just have it backup the Altiris database to that variable location.
Here is what the script looks like:
declare @Filename varchar(100) set @Filename = 'c:\database\Altiris_' + convert(varchar(20),getdate(),110) + '.bak' print @Filename backup database Altiris to disk = @Filename with init