Chat now with support
Chat with Support

LiteSpeed for SQL Server 8.9.5 - Installation Guide

SmartCleanup Command-Line Arguments

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:

  • The backup files, if there are mixed backups in the same backup file. For example, if a user performs a backup of AdventureWorks and Pubs into the same mybackups.bak backup file.
  • The full backup, if there are associated differential or t-log backups in the backup set that are not eligible for cleanup.
  • File/FileGroup backups
  • File/FileGroup differential backups
  • Partial backups
  • Partial differential backups
  • Files that have the filesystem archive bit set (if that option is selected)

Syntax

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>]

[--CloudEndpoint <cloud endpoint:port>]

[--CloudAcceptAllCertificates <0 or 1>]

[--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"]]

Arguments

NOTES:

  • Single-letter arguments are case-sensitive, and they can be preceded by a figure dash '-' or '/'.
  • Verbose multi-letter arguments are not case-sensitive, they must be preceded by double dashes '--'.

-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 --BackupRetain

Specifies the number of units (N). The full or differential backup must be at least N units old before it is eligible for cleanup.

See BackupRetainUnits for unit types details

Note: Old argument BackupRetainDays is still supported for compatibility reasons.

(none) --BackupRetainUnits

Defines unit type for BackupRetain argument.

Allowed values: hour / day / week / month / year.

Note: Month = 30 days, Year = 365 days

-c --BackupExpiration

Specifies the date using one of the following formats:

YYYY-MM-DD

YYYY-MM-DD HH:MM:SS

where

  • YYYY—4-digit year
  • MM—2-digit month
  • DD—2-digit day of the month
  • HH—2-digit hour using the local 24-hour clock
  • MM—2-digit minute
  • SS—2-digit second

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:

  • Default—LiteSpeed will ignore copy-only backups except on secondary replicas in AlwaysOn Availability groups, in which case it will allow deletions. This is the default behavior when the parameter is not specified.
  • Ignore—Copy-only backups are never deleted.
  • AllowDeletes—Copy-only backups are removed according to the specified retention options.

NOTES:

  • Transaction log backups are not considered dependent on copy-only full or copy-only tlog backups.
  • Copy-only transaction log backups will not mark other transaction log or full backups as having a dependent.
  • The values are not case-sensitive.
-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

  • YYYY—4-digit year
  • MM—2-digit month
  • DD—2-digit day of the month
  • HH—2-digit hour using the local 24-hour clock
  • MM—2-digit minute
  • SS—2-digit second

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:

  • 0—Logging off.

  • 1 or any odd value—Logging on. Log file is removed on success.

  • 2 or any even value—Logging on.

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".

For more information, see Configure Logging in LiteSpeed.

-l --LogRetain

Specifies the number of units (N). The t-log backup must be at least N units old before it is eligible for cleanup.

See also LogRetainUnits for unit types details

Note: Old argument @LogRetainDays is still supported for compatibility reasons.

(none) --LogRetainUnits

Defines unit type for LogRetain argument.

Allowed values: hour / day / week / month / year.

Note: Month = 30 days, Year = 365 days

(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:

  • All - Cleanup backups for all system and user databases.
  • System - Cleanup backups for only system databases.
  • User - Cleanup backups for only user databases.
  • Selected - Cleanup backups for specifically selected databases.
(none) --ReviewAllBackups

Specifies Smart Cleanup behavior for searching backups to delete

  1. 0 - Save last deleted backup ID and start check backups from this backup next time (default).
  2. 1 - Review all backups from MSDB backups history (takes more time)
(none) --Locations

Defines locations (spread by semicolon symbol) to apply cleanup policy.

Disk: “F:\\Backups; F:\\mirrors”

Cloud folders: "fff\; test123\"

-S --Server

Specifies the instance of Microsoft SQL Server to connect to. This argument accepts one of the following values:

  • server_name
  • server_name\instance_name

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

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, S3 Compatible Storage Access Key.

(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, S3 Compatible Storage Bucket Name,

(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:

  • 0—Do not use government cloud (default)
  • 1—Use government cloud
(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", "GoogleStorage" or "S3Compatible".

(none) --CloudEndpoint

The @CloudEndpoint argument specifies the endpoint for S3 Compatible Storage and custom endpoint for Amazon S3 service (in case of VPC). Format: servername:port .Example values: "servername", "servername:port", "ip:port", "10.0.0.200:9021".

(none) --CloudAcceptAllCertificates

The @CloudAcceptAllCertificates argument instructs LiteSpeed accept self-signed certificates for S3 Compatible Storage. This argument accepts one of the following values:

  • 0—Accept verified certificates only (default)
  • 1—Accept self-signed certificates

Note: Delete backups is not supported in Maintenance Plans with this option.

(none)

--UseSSL

The @UseSSL argument specifies that the connection uses SSL security. This argument accepts one of the following values:

  • 0—Do not use SSL
  • 1—Use SSL (default)

Proxy-Specific Arguments

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.

note: If the @ProxyHost argument is not defined, then the LiteSpeed core engine checks the local .ini files for the proxy parameters. If the proxy parameters are not detected, then the LiteSpeed core engine connects directly to the proxy servers.

(none) --ProxyLogin

The @ProxyLogin argument is optional and specifies the proxy server login credential.

note: If not defined, then the LiteSpeed core engine checks the local .ini files for the proxy parameters. If the proxy parameters are not detected, then the LiteSpeed core engine connects directly to the proxy servers.

(none) --ProxyPassword

The @ProxyPassword argument is optional and specifies the proxy server password credential.

note: If the @ProxyPassword argument is not defined, then the LiteSpeed core engine checks the local .ini files for the proxy parameters. If the proxy parameters are not detected, then the LiteSpeed core engine connects directly to the proxy servers.

(none) --ProxyPasswordEnc

The @ProxyPasswordEnc argument is optional and specifies the encrypted proxy server password credential.

note: If the @ProxyPasswordEnc argument is not defined, then the LiteSpeed core engine checks the local .ini files for the proxy parameters. If the proxy parameters are not detected, then the LiteSpeed core engine connects directly to the proxy servers.

(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.

note: If the @ProxyPort argument is not defined, then the LiteSpeed core engine checks the local .ini files for the proxy parameters. If the proxy parameters are not detected, then the LiteSpeed core engine connects directly to the proxy servers.

Example

  1. 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 --BackupRetain 28 --BackupRetainUnits “day” --LogRetain 2 --LogRetainUnits “day” --Locations “F:\\Backups; F:\\mirrors” --CopyOnlyBackups AllowDeletes --Server LITESPEED\SQL2005 -U sa -P *******

  2. Delete disk full and differential backups created before 11/15/2012:

    SLSSmartCleanup.exe --Database test2 --BackupExpiration "2012-11-15" --Server LITESPEED\SQL2005 --WindowsAuth

  3. 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

  4. 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

  5. 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"

Returns

0 (success) or 1 (failure)

  

Related Topics

Related Documents

The document was helpful.

Select Rating

I easily found the information I needed.

Select Rating