Auto named files in multi-file backup have different names
pcassar
Posts: 5 Bronze 1
When I split up backups into multiple files, sometimes not all of the files will get the same name... the seconds portion of the filename will be different. This is probably when the seconds portion of the time is different between generation of the names for the files.
Is it possible to use <AUTO> in a multi-file backup and get the same filename for all of the files? I can of course pre-generate the file names, but I like using <AUTO>.
Thanks!
Is it possible to use <AUTO> in a multi-file backup and get the same filename for all of the files? I can of course pre-generate the file names, but I like using <AUTO>.
Thanks!
Comments
Thanks.
SQL Backup Consultant Developer
Associate, Yohz Software
Beyond compression - SQL Backup goodies under the hood, updated for version 8
EXECUTE master..sqlbackup '-SQL "BACKUP DATABASE [DATABASENAME] TO DISK = ''F:\SQLBackups\<AUTO>_01.sqb'', DISK = ''F:\SQLBackups\<AUTO>_02.sqb'', DISK = ''F:\SQLBackups\<AUTO>_03.sqb'', DISK = ''F:\SQLBackups\<AUTO>_04.sqb'', DISK = ''F:\SQLBackups\<AUTO>_05.sqb'', DISK = ''F:\SQLBackups\<AUTO>_06.sqb'', DISK = ''F:\SQLBackups\<AUTO>_07.sqb'', DISK = ''F:\SQLBackups\<AUTO>_08.sqb'', DISK = ''F:\SQLBackups\<AUTO>_09.sqb'', DISK = ''F:\SQLBackups\<AUTO>_10.sqb'', DISK = ''F:\SQLBackups\<AUTO>_11.sqb'', DISK = ''F:\SQLBackups\<AUTO>_12.sqb'', DISK = ''F:\SQLBackups\<AUTO>_13.sqb'', DISK = ''F:\SQLBackups\<AUTO>_14.sqb'', DISK = ''F:\SQLBackups\<AUTO>_15.sqb'', DISK = ''F:\SQLBackups\<AUTO>_16.sqb'', DISK = ''F:\SQLBackups\<AUTO>_17.sqb'', DISK = ''F:\SQLBackups\<AUTO>_18.sqb'', DISK = ''F:\SQLBackups\<AUTO>_19.sqb'', DISK = ''F:\SQLBackups\<AUTO>_20.sqb'' WITH ERASEFILES = 1b, DISKRETRYINTERVAL = 30, DISKRETRYCOUNT = 10, COMPRESSION = 0, VERIFY, CHECKSUM"', @exitcode OUT, @sqlerrorcode OUT
Here is a sample set of files generated from that:
FULL_(local)_DATABASENAME_20120807_023000_14.sqb
FULL_(local)_DATABASENAME_20120807_023000_15.sqb
FULL_(local)_DATABASENAME_20120807_023000_16.sqb
FULL_(local)_DATABASENAME_20120807_023000_17.sqb
FULL_(local)_DATABASENAME_20120807_023000_18.sqb
FULL_(local)_DATABASENAME_20120807_023000_19.sqb
FULL_(local)_DATABASENAME_20120807_023000_20.sqb
FULL_(local)_DATABASENAME_20120807_023001_01.sqb
FULL_(local)_DATABASENAME_20120807_023001_02.sqb
FULL_(local)_DATABASENAME_20120807_023001_03.sqb
FULL_(local)_DATABASENAME_20120807_023001_04.sqb
FULL_(local)_DATABASENAME_20120807_023001_05.sqb
FULL_(local)_DATABASENAME_20120807_023001_06.sqb
FULL_(local)_DATABASENAME_20120807_023001_07.sqb
FULL_(local)_DATABASENAME_20120807_023001_08.sqb
FULL_(local)_DATABASENAME_20120807_023001_09.sqb
FULL_(local)_DATABASENAME_20120807_023001_10.sqb
FULL_(local)_DATABASENAME_20120807_023001_11.sqb
FULL_(local)_DATABASENAME_20120807_023001_12.sqb
FULL_(local)_DATABASENAME_20120807_023001_13.sqb
File name format (this is the default):
<TYPE>_<INSTANCE>_<DATABASE>_<DATETIME yyyymmdd_hhnnss>
I can remove the seconds portion from the <AUTO> but the same thing could happen when crossing to a new minute.
Thanks for the help!
SQL Backup Consultant Developer
Associate, Yohz Software
Beyond compression - SQL Backup goodies under the hood, updated for version 8