Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added @ExpireDate and @RetainDays parameters #879

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jimp100
Copy link

@jimp100 jimp100 commented Jan 24, 2025

Added support for WITH options EXPIREDATE and RETAINDAYS.

These arguments are supported by native SQL Server and LiteSpeed backups.

SQL Server: { EXPIREDATE ='date' | RETAINDAYS = days }
Reference: https://learn.microsoft.com/en-us/sql/t-sql/statements/backup-transact-sql?view=sql-server-ver16#arguments

LiteSpeed implementation as arguments for xp_backup_database:
@expiration = 'yyyy-mm-dd | yyyy-mm-dd hh:mm:ss'
@retaindays = int
Reference: https://support.quest.com/technical-documents/litespeed-for-sql-server/8.9.8/user-guide/20#@expiration, https://support.quest.com/technical-documents/litespeed-for-sql-server/8.9.8/user-guide/20#@retaindays

Validation added:

  • Negative @RetainDays values
  • Use with invalid @BackupSoftware values

Note: Values can legitimately be passed to both arguments, in which case RETAINDAYS takes priority.

Tested successfully with native SQL Backups.

Implements #150

Implements support for backup options:

Native SQL:  { EXPIREDATE ='date' | RETAINDAYS = days }

LiteSpeed SQL: @Expiration, @retaindays
@olahallengren
Copy link
Owner

@jimp100, could you describe how you will be using this feature?

I also wonder if xp_delete_file is taking this setting into account.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants