The variables are different for the xp_backup_database than for slssqlmaint.
解决办法
The engine In LiteSpeed Version 5.x automatically substitutes variables on stripe filenames (-F), mirror filenames (-E), backup names (-n), backup descriptions (-d), and comments (-Y). You can use the following variables:
Variable & Description
%D Database name %T Backup type (full, diff, log) %z Timestamp
Date and time variables %a Abbreviated weekday name %A Full weekday name %b Abbreviated month name %B Full month name %d Day of the month (01-31) %H Hour in 24h format (00-23) %I Hour in 12h format (01-12) %j Day of the year (001-366) %m Month as a decimal number %M Minute (00-59) %p AM or PM designation %S Second (00-61) %U Week number with the first Sunday as the first day of week one (00-53) %w Weekday as a decimal number with Sunday as 0 (0-6) %W Week number with the first Monday as the first day of week one (00-53) %y Year, last two digits (00-99) %Y Year %Z Time zone name or abbreviation
You can use variables anywhere you need to specify a backup file name, comment, or description: in the LiteSpeed console, in the command-line interface, and when using extended stored procedures.
Example to create a filename: "full_Northwind_Tue_20091103082425.BAK:" exec master.dbo.xp_backup_database @database = NNorthwind, @backupname = NNorthwind - Full Database Backup, @compressionlevel = 1, @filename = ND:\Backup\2005\%T_%D_%a_%Y%m%d%H%M%S.BAK, @init = 1, @with = NSKIP, @with = NSTATS = 10 GO
The following set of macros may be used for backup file names when creating maintenance plans: Variable & Description %DEFAULTDIR% Default directory %DATABASENAME% Database name %DATE% Date %TIME% Time (hhmm) %DATETIME% Date and time %TYPE% Backup type (_full_,_diff_,_tlog_, _file_)