Backup Folder
guant
Posts: 14
Ok, I'm a noob here but have a pretty basic question I think. In sql backup I'm going to create a daily backup job and I want to keep up to 90 days worth on disk. Is there anyway that you can automatically create a new folder for each backup so I could put the date on the folder and have that days backup go into that folder, then the next, and so on....This way things would be better organized instead of having one folder with tons of backup files
Thank you!
Thank you!
Comments
If I understand correctly, you want to create a folder (with date) and put all the backup files for that particular date into this folder.
If I have understood your requirement correctly then you can use tags for this. You can set default backup folder path using tags via Tools > Server Options .
For your requirement you can use a tag like in below script:
EXECUTE master..sqlbackup '-SQL "BACKUP DATABASE [Test] TO DISK = ''C:\temp\sql2000\<DATETIME yyyymmdd>\<AUTO>.sqb'' WITH INIT"'
This will create a folder (with yyyymmdd as its name) and put the backup files in it. If the folder doesn't exist then SQL Backup will create it or else it will use the existing one.
Thanks,
Priya
Project Manager
Red Gate Software