File location tags
Published 23 March 2017
SQL Backup Pro enables you to set up file locations that are automatically generated when the backup is created, by using tags. For example, you can use tags to include the date and time of creation of a backup in its file name:
C:\Backups\<DATETIME yyyymmdd_hhnnss>_Backup.sqb
Tags are particularly useful when you are backing up multiple databases in one operation. For example, you could specify that the backup files for each database are to be created in a separate folder using the <DATABASE> tag in the path:
C:\Backups\<DATABASE>\Backup.sqb
You can use the following tags in paths and file names:
<TYPE> | The backup type. SQL Backup Pro will use the following values:
|
<SERVER> | The SQL Server name. |
<CLUSTER> | The name of the cluster or SERVER> if NOT on a clustered instance |
<INSTANCE> | The SQL Server instance name. |
< AVAILABILITYGROUP >
| The name of the availability group or <INSTANCE> if NOT on a clustered instance. |
<DATABASE> | The database name. |
<DATETIME x> | The date and time value of the backup process, where x is a format string. The values that you can use in the format string are listed below, under Date and time format. Note that you can use only many DATETIME tags in the default name. |
<AUTO> | If you specify <AUTO>, SQL Backup Pro uses the backup file location options (see File management options) to generate the backup file path and file name. If no backup location options have been set up, SQL Backup Pro uses the SQL Server instance's default backup folder, and the default format for file names. If you specify a path and <AUTO> (for example C:\MyBackups\<AUTO>), SQL Backup Pro uses the specified path, and generates the file name using the Backup Location options. If no backup location options have been set up, SQL Backup Pro uses the default format for file names. If you specify <AUTO> with a file extension (for example <AUTO>.sqb, SQL Backup Pro uses the Backup Location options to generate the backup file path and file name. If no backup settings have been set up, SQL Backup Pro uses the SQL Server instance's default backup folder, and the default format for file names. This is useful when you generate split backup files. |
Date and time format
You can use the following formats for string x in the <DATETIME x> tag.
d | Displays the day as a number without a leading zero (1-31). |
dd | Displays the day as a number with a leading zero (01-31). |
ddd | Displays the day as an abbreviation (Sun-Sat) using the strings given by the ShortDayNames global variable. |
dddd | Displays the day as a full name (Sunday-Saturday) using the strings given by the LongDayNames global variable. |
ddddd | Displays the date using the format given by the ShortDateFormat global variable. |
dddddd | Displays the date using the format given by the LongDateFormat global variable. |
m | Displays the month as a number without a leading zero (1-12). If the m specifier immediately follows an h or hh specifier, the minute rather than the month is displayed. |
mm | Displays the month as a number with a leading zero (01-12). If the mm specifier immediately follows an h or hh specifier, the minute rather than the month is displayed. |
mmm | Displays the month as an abbreviation (Jan-Dec) using the strings given by the ShortMonthNames global variable. |
mmmm | Displays the month as a full name (January-December) using the strings given by the LongMonthNames global variable. |
yy | Displays the year as a two-digit number (00-99). |
yyyy | Displays the year as a four-digit number (0000-9999). |
h | Displays the hour without a leading zero (0-23). |
hh | Displays the hour with a leading zero (00-23). |
n | Displays the minute without a leading zero (0-59). |
nn | Displays the minute with a leading zero (00-59). |
s | Displays the second without a leading zero (0-59). |
ss | Displays the second with a leading zero (00-59). |