The slsSmartCleanup command-line utility (slsSmartCleanUp.exe) allows you to find and remove old full, differential and transaction log backups based on a user-defined period (either the file age or the date).
The backup retention will never delete:
Files that have the filesystem archive bit set (if that option is selected)
slsSmartCleanup.exe ( -? | --ShowHelp | --ShowSyntax | <options> )
Connection options:
--Database <database_name>
--Server <server_name>
--WindowsAuth | (--UserName <username> --Password <password>)
Cleanup options:
--BackupRetainDays <number> | --BackupExpiration <date>
--LogRetainDays <number> | --LogExpiration <date>
--KeepArchiveFiles
--MultiDatabaseType
[--CopyOnlyBackups <option>]
TSM connection options:
[--TSMConfigFile <path>]
[--TSMClientNode <node>]
[--TSMClientOwnerPwd <password>]
[--TSMdsmi_dir <path>]
[--TSMdsmi_log <path>]
[--TSMLogName <name>]
[--TSMAdminName <name>]
[--TSMAdminPwd <password>]
[Cloud connection options:]
[--CloudVendor <vendor name>]
[--CloudAccessKey <key name>]
[--CloudAccessKeyEnc <encrypted key name>]
[--CloudAutoStriping <1 or 0>]
[--CloudAutoStripingThreshold <auto, number GB>]
[--CloudSecretKey <key name>]
[--CloudSecretKeyEnc <encrypted key name>]
[--CloudBucketName <bucket name>]
[--CloudRegionName <cloud region name>]
[--CloudGovRegion <government region number>]
[Proxy connection options:]
[--ProxyHost <proxy host name>]
[--ProxyLogin <proxy server login credential>]
[--ProxyPassword <proxy server password credential>]
[--ProxyPasswordEnc <encrypted proxy server password credential>]
[--ProxyPort <proxy server port number>]
Other options:
[--DryRun]
[--LogLevel (0|1|2) [--trace logpath = "path"]]
NOTES:
-Argument |
--Argument |
Description |
---|---|---|
-a | --KeepArchiveFiles |
Turns on monitoring and refuses to delete files that have the archive filesystem bit set. When enabled dependent files are not deleted. |
-b | --BackupRetainDays |
Specifies the number of days (N). The full or differential backup must be at least N days old before it is eligible for cleanup. |
-c | --BackupExpiration |
Specifies the date using one of the following formats: YYYY-MM-DD YYYY-MM-DD HH:MM:SS where
To be eligible for cleanup, the full or differential backup must be older than this date. |
-C | --CopyOnlyBackups |
Controls how LiteSpeed handles copy-only backups. This argument accepts one of the following values:
NOTES:
|
-D | --Database |
Name of database to be backed up or restored. Only backups of this database are eligible for cleanup. |
(none) | --Destination | Specifies the instance of the destination server to cleanup. |
-d | --DryRun |
Displays backups that are to be removed (delete candidates) or kept according to the specified conditions and SmartCleanup logic. SmartCleanup does not remove any backups, if this parameter is specified. |
-k | --LogExpiration |
Specifies the date of one of the following formats: YYYY-MM-DD YYYY-MM-DD HH:MM:SS where
To be eligible for cleanup, the t-log backup must be older than this date. |
-L | --LogLevel |
Creates a log file. This argument accepts one of the following values:
The default output directory is C:\Documents and Settings\All Users\Application Data\Quest Software\LiteSpeed\SQL Server\Logs (or C:\ProgramData\Quest Software\LiteSpeed\SQL Server\Logs) (or C:\ProgramData\Quest Software\LiteSpeed\SQL Server\Logs). To log to a different directory run this utility with the following argument: --trace logpath = "path". |
-l | --LogRetainDays |
Specifies the number of days (N). The t-log backup must be at least N days old before it is eligible for cleanup. |
(none) | --MultiDatabaseType |
Produces a cleanup for several types of databases. Types can include: all, system, user, or selected databases. This argument accepts one of the following values:
|
-S | --Server |
Specifies the instance of Microsoft SQL Server to connect to. This argument accepts one of the following values:
If no server is specified, the LiteSpeed command-line utility will connect to the default instance of SQL Server on the local computer. |
(none) | --ServerToDelete |
Specifies the instance of the destination server to delete. |
(none) | --TSMAdminName |
Specifies the TSM administrative user name that has client authority for the TSM node. Some operations may require an administrative user with client owner authority to be specified in order to open a TSM session. The correct username and password may be obtained from the TSM administrator. |
(none) | --TSMAdminPwd |
Specifies the plain text password of the administrative user which is used to log in to the TSM server and start the TSM session. |
(none) | --TSMClientNode |
Specifies the TSM server LiteSpeed connects to during backups and restores. Not required, if specified in the options file or if backing up with the Passwordaccess Generate option. |
(none) | --TSMClientOwnerPwd |
Specifies the TSM client owner user password. Not required, if specified in the options file or if backing up with the Passwordaccess Generate option. |
-j | --TSMConfigFile |
Specifies the TSM configuration file. |
(none) | --TSMdsmi_dir |
DSMI_DIR path if needed. |
(none) | --TSMdsmi_log |
DSMI_LOG path. |
(none) | --TSMLogName |
Log name. |
-U | --UserName |
Specifies user login ID. Required if the connection type is not a trusted connection. Login IDs are case-sensitive. |
-P | --Password |
Specifies the user password. Passwords are case-sensitive. Required if the connection type is not a trusted connection. |
-T | --WindowsAuth | Specifies Windows authentication. Uses a trusted connection (to the server) instead of requiring a password. |
-? | --ShowHelp |
Displays the syntax summary of the LiteSpeed command-line utility. |
(none) | --ShowSyntax | Displays the utility syntax. |
Cloud-specific arguments work in conjunction with the LiteSpeed arguments. See Syntax and SmartCleanup Command-Line Arguments for more information.
-Argument |
--Argument |
Description |
---|---|---|
(none) | --CloudAccessKey |
The @CloudAccessKey argument specifies the name of the unique Cloud Web Service alphanumeric access key that identifies each user. The selections include Amazon Access Key, Azure Account Name, Google e-mail styled account. |
(none) | --CloudAccessKeyEnc |
The @CloudAccessKeyEnc argument specifies the name of the encrypted unique Cloud Web Service alphanumeric access key that identifies each user. |
(none) | --CloudBucketName |
The @CloudBucketName argument specifies the name of the container for cloud objects. Bucket names must be at least 3 and no more than 63 characters long. The selections are Amazon Bucket Name, Azure Container Name, Google Bucket Name. Google Bucket Name requirements are described at https://cloud.google.com/storage/docs/naming. |
(none) | --CloudGovRegion |
The @CloudGovRegion argument enables a special restricted region for the US Government use in Amazon S3 and Azure Clouds. This argument accepts one of the following values:
|
(none) | --CloudRegionName |
The @CloudRegionName argument specifies the name of the Cloud Web Service region to use for a bucket. Example values are but not limited to: us-east-1, us-east-2, us-west-1, us-west-2, ca-central-1, eu-central-1, eu-west-1, eu-west-2, ap-south-1, ap-southeast-1, ap-southeast-2, ap-northeast-1, ap-northeast-2, sa-east-1, N'Germany' and N'China'. |
(none) | --CloudSecretKey |
The @CloudSecretKey argument specifies the name of the Cloud Web Service secret key that is assigned when you initially get a Cloud account. |
(none) | --CloudSecretKeyEnc |
The @CloudSecretKeyEnc argument specifies the name of the encrypted Cloud Web Service secret key that is assigned when you initially get a Cloud account. |
(none) | --CloudVendor |
The @CloudVendor argument specifies the name of the cloud service provider. The argument accepts one of the following values: "AmazonS3", "AzureBlob" or "GoogleStorage". |
(none) |
--UseSSL |
The @UseSSL argument specifies that the connection uses SSL security. This argument accepts one of the following values:
|
Proxy-specific arguments work in conjunction with the LiteSpeed arguments. See Syntax and SmartCleanup Command-Line Arguments for more information.
-Argument |
--Argument |
Description | |
---|---|---|---|
(none) |
--ProxyHost |
The @ProxyHost argument is optional and specifies the name of the proxy host name that is running the proxy server.
| |
(none) | --ProxyLogin |
The @ProxyLogin argument is optional and specifies the proxy server login credential.
| |
(none) | --ProxyPassword |
The @ProxyPassword argument is optional and specifies the proxy server password credential.
| |
(none) | --ProxyPasswordEnc |
The @ProxyPasswordEnc argument is optional and specifies the encrypted proxy server password credential.
| |
(none) | --ProxyPort |
The @ProxyPort argument is optional and contains the port number of the proxy server. The TCP/IP port values can be 1-65535.
|
Delete disk full and differential backups older than 28 days, delete log backups older than 2 days, allow deletions of the copy-only backups:
SLSSmartCleanup.exe --Database test2 --BackupRetainDays 28 --LogRetainDays 2 --CopyOnlyBackups AllowDeletes --Server LITESPEED\SQL2005 -U sa -P *******
Delete disk full and differential backups created before 11/15/2012:
SLSSmartCleanup.exe --Database test2 --BackupExpiration "2012-11-15" --Server LITESPEED\SQL2005 --WindowsAuth
Delete tsm log backups older than 2 days:
SLSSmartCleanup.exe --Database test_tsm --TSMConfigFile "C:\Program Files\Tivoli\TSM\baclient\dsm.opt" --TSMClientNode w2k3_TSM2 --TSMClientOwnerPwd ***** --LogRetainDays 2 --WindowsAuth
Delete full, differential and log TSM backups created before 06/15/2012, using the PASSWORDAccess generate option to connect to the TSM Server:
SLSSmartCleanup.exe --Database test_tsm --TSMConfigFile "C:\Program Files\Tivoli\TSM\baclient\dsm_gp.opt" --BackupExpiration 2012-06-15 --LogExpiration 2012-06-15 --WindowsAuth
Delete Amazon S3 cloud backup.
TIP: The parameter “-CSecretKey” must be generated by the Maintenance plan wizard and cut\paste into the command line script.
SLSsmartcleanup.exe -D model --BackupExpiration "2014-03-02 00:00:00" --CloudVendor "AmazonS3" --CloudBucketName "california" --CloudAccessKey "***** " --CloudSecretKey "******" --CloudRegionName "us-west-1" --UseSSL -S"servername"
0 (success) or 1 (failure)
© 2024 Quest Software Inc. ALL RIGHTS RESERVED. Conditions d’utilisation Confidentialité Cookie Preference Center