����JFIF���������
__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
#!powershell
# -*- coding: utf-8 -*-
# (c) 2022, John McCall (@lowlydba)
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#AnsibleRequires -CSharpUtil Ansible.Basic
#AnsibleRequires -PowerShell ansible_collections.lowlydba.sqlserver.plugins.module_utils._SqlServerUtils
#Requires -Modules @{ ModuleName="dbatools"; ModuleVersion="1.1.112" }
$ErrorActionPreference = "Stop"
$spec = @{
supports_check_mode = $true
options = @{
database = @{type = 'str'; required = $true }
path = @{type = 'str'; required = $false }
file_path = @{type = 'str'; required = $false }
increment_prefix = @{type = 'bool'; required = $false; default = $false }
replace_in_name = @{type = 'bool'; required = $false; default = $false }
copy_only = @{type = 'bool'; required = $false; default = $false }
type = @{type = 'str'; required = $false; default = 'database'; choices = @('full', 'log', 'differential', 'diff', 'database') }
timestamp_format = @{type = 'str'; required = $false }
encryption_certificate = @{type = 'str'; required = $false }
encryption_algorithm = @{type = 'str'; required = $false; choices = @('AES128', 'AES192', 'AES256', 'TRIPLEDES') }
create_folder = @{type = 'bool'; required = $false; default = $false }
file_count = @{type = 'int'; required = $false; default = 0 }
compress = @{type = 'bool'; required = $false; default = $false }
checksum = @{type = 'bool'; required = $false; default = $false }
verify = @{type = 'bool'; required = $false; default = $false }
no_recovery = @{type = 'bool'; required = $false; default = $false }
build_path = @{type = 'bool'; required = $false; default = $false }
max_transfer_size = @{type = 'int'; required = $false; default = 0 }
with_format = @{type = 'bool'; required = $false; default = $false }
initialize = @{type = 'bool'; required = $false; default = $false }
ignore_file_checks = @{type = 'bool'; required = $false; default = $false }
block_size = @{type = 'str'; required = $false; choices = @('0.5kb', '1kb', '2kb', '4kb', '8kb', '16kb', '32kb', '64kb') }
buffer_count = @{type = 'int'; required = $false; default = 0 }
azure_base_url = @{type = 'str'; required = $false }
azure_credential = @{type = 'str'; required = $false }
}
mutually_exclusive = @(
, @('path', 'azure_base_url')
)
required_together = @(
, @('encryption_algorithm', 'encryption_certificate')
)
}
$module = [Ansible.Basic.AnsibleModule]::Create($args, $spec, @(Get-LowlyDbaSqlServerAuthSpec))
$sqlInstance, $sqlCredential = Get-SqlCredential -Module $module
$database = $module.Params.database
$path = $module.Params.path
$filePath = $module.Params.file_path
$incrementPrefix = $module.Params.increment_prefix
$replaceInName = $module.Params.replace_in_name
$copyOnly = $module.Params.copy_only
$type = $module.Params.type
$createFolder = $module.Params.create_folder
$fileCount = $module.Params.file_count
$compressBackup = $module.Params.compress_backup
$checkSum = $module.Params.checksum
$verify = $module.Params.verify
$maxTransferSize = $module.Params.max_transfer_size
$blockSize = $module.Params.block_size
$bufferCount = $module.Params.buffer_count
$noRecovery = $module.Params.no_recovery
$buildPath = $module.Params.build_path
$withFormat = $module.Params.with_format
$initialize = $module.Params.initialize
$timestampFormat = $module.Params.timestamp_format
$ignoreFileChecks = $module.Params.ignore_file_checks
$encryptionAlgorithm = $module.Params.encryption_algorithm
$encryptionCertificate = $modules.Params.encryption_certificate
$azureBaseUrl = $modules.Params.azure_base_url
$azureCredential = $modules.Param.azure_credential
$checkMode = $module.CheckMode
$module.Result.changed = $false
$PSDefaultParameterValues = @{ "*:EnableException" = $true; "*:Confirm" = $false; "*:WhatIf" = $checkMode }
try {
$backupSplat = @{
SqlInstance = $sqlInstance
SqlCredential = $sqlCredential
Database = $database
IncrementPrefix = $incrementPrefix
ReplaceInName = $replaceInName
CopyOnly = $copyOnly
Type = $type
CreateFolder = $createFolder
FileCount = $fileCount
CompressBackup = $compressBackup
Checksum = $checkSum
Verify = $verify
MaxTransferSize = $maxTransferSize
BufferCount = $bufferCount
NoRecovery = $noRecovery
BuildPath = $buildPath
WithFormat = $withFormat
Initialize = $initialize
IgnoreFileChecks = $ignoreFileChecks
}
if ($null -ne $path) {
$backupSplat.Add("Path", $path)
}
if ($null -ne $filePath) {
$backupSplat.Add("FilePath", $filePath)
}
if ($null -ne $blockSize) {
$backupSplat.Add("BlockSize", ($blockSize / 1))
}
if ($null -ne $timestampFormat) {
$backupSplat.Add("TimestampFormat", $timestampFormat)
}
if ($null -ne $encryptionAlgorithm) {
$backupSplat.Add("EncryptionAlgorithm", $encryptionAlgorithm)
}
if ($null -ne $encryptionCertificate) {
$backupSplat.Add("EncryptionCertificate", $encryptionCertificate)
}
if ($null -ne $azureBaseUrl) {
$backupSplat.Add("AzureBaseURL", $azureBaseUrl)
}
if ($null -ne $azureCredential) {
$backupSplat.Add("AzureCredential", $azureCredential)
}
$output = Backup-DbaDatabase @backupSplat
if ($null -ne $output) {
$resultData = ConvertTo-SerializableObject -InputObject $output
$module.Result.data = $resultData
$module.Result.changed = $true
}
$module.ExitJson()
}
catch {
$module.FailJson("Error backing up database: $($_.Exception.Message).", $_)
}
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| __pycache__ | Folder | 0755 |
|
|
| ag_listener.ps1 | File | 3.12 KB | 0644 |
|
| ag_listener.py | File | 2.22 KB | 0644 |
|
| ag_replica.ps1 | File | 7.88 KB | 0644 |
|
| ag_replica.py | File | 4.71 KB | 0644 |
|
| agent_job.ps1 | File | 4.56 KB | 0644 |
|
| agent_job.py | File | 2.36 KB | 0644 |
|
| agent_job_category.ps1 | File | 2.17 KB | 0644 |
|
| agent_job_category.py | File | 1.29 KB | 0644 |
|
| agent_job_schedule.ps1 | File | 6.36 KB | 0644 |
|
| agent_job_schedule.py | File | 4.83 KB | 0644 |
|
| agent_job_step.ps1 | File | 6.3 KB | 0644 |
|
| agent_job_step.py | File | 3.34 KB | 0644 |
|
| availability_group.ps1 | File | 9.56 KB | 0644 |
|
| availability_group.py | File | 4.93 KB | 0644 |
|
| backup.ps1 | File | 5.73 KB | 0644 |
|
| backup.py | File | 5.75 KB | 0644 |
|
| credential.ps1 | File | 4.29 KB | 0644 |
|
| credential.py | File | 2.44 KB | 0644 |
|
| database.ps1 | File | 9.21 KB | 0644 |
|
| database.py | File | 2.55 KB | 0644 |
|
| dba_multitool.ps1 | File | 2.11 KB | 0644 |
|
| dba_multitool.py | File | 1.98 KB | 0644 |
|
| first_responder_kit.ps1 | File | 2.77 KB | 0644 |
|
| first_responder_kit.py | File | 2.74 KB | 0644 |
|
| hadr.ps1 | File | 2.39 KB | 0644 |
|
| hadr.py | File | 1.69 KB | 0644 |
|
| install_script.ps1 | File | 3.19 KB | 0644 |
|
| install_script.py | File | 3.27 KB | 0644 |
|
| instance_info.ps1 | File | 1.76 KB | 0644 |
|
| instance_info.py | File | 931 B | 0644 |
|
| login.ps1 | File | 5.35 KB | 0644 |
|
| login.py | File | 2.44 KB | 0644 |
|
| maintenance_solution.ps1 | File | 3.92 KB | 0644 |
|
| maintenance_solution.py | File | 3.24 KB | 0644 |
|
| memory.ps1 | File | 1.49 KB | 0644 |
|
| memory.py | File | 1.23 KB | 0644 |
|
| nonquery.ps1 | File | 1.49 KB | 0644 |
|
| nonquery.py | File | 1.26 KB | 0644 |
|
| resource_governor.ps1 | File | 2.15 KB | 0644 |
|
| resource_governor.py | File | 1.33 KB | 0644 |
|
| restore.ps1 | File | 7.63 KB | 0644 |
|
| restore.py | File | 7.29 KB | 0644 |
|
| rg_resource_pool.ps1 | File | 4.22 KB | 0644 |
|
| rg_resource_pool.py | File | 2.56 KB | 0644 |
|
| rg_workload_group.ps1 | File | 4.44 KB | 0644 |
|
| rg_workload_group.py | File | 2.96 KB | 0644 |
|
| sa.ps1 | File | 3.5 KB | 0644 |
|
| sa.py | File | 1.97 KB | 0644 |
|
| sp_configure.ps1 | File | 1.84 KB | 0644 |
|
| sp_configure.py | File | 1.4 KB | 0644 |
|
| sp_whoisactive.ps1 | File | 1.62 KB | 0644 |
|
| sp_whoisactive.py | File | 1.67 KB | 0644 |
|
| spn.ps1 | File | 2.66 KB | 0644 |
|
| spn.py | File | 1.87 KB | 0644 |
|
| tcp_port.ps1 | File | 2.35 KB | 0644 |
|
| tcp_port.py | File | 1.72 KB | 0644 |
|
| traceflag.ps1 | File | 2.11 KB | 0644 |
|
| traceflag.py | File | 1.53 KB | 0644 |
|
| user.ps1 | File | 4.76 KB | 0644 |
|
| user.py | File | 2 KB | 0644 |
|