< Back
AZBlobBackup
Post
NAME AZBlobBackup
SYNOPSIS
Compress folders and upload them to Azure Blob Storage.
SYNTAX
AZBlobBackup [-OutputFolder] <String> [-InputFolders] <Object> [-DiffBackup] [-AZUpload] [[-AZContainerName]
<String>] [[-AZContext] <IStorageContext>] [[-AZResourceGroupName] <String>] [[-AZStorageAccountName] <String>]
[-AZAcquireLease] [-Force] [[-ArchiveFormat] <String>] [[-SevenZPath] <String>] [[-SevenZUpdateSwitch] <String>]
[[-LogFile] <String>] [<CommonParameters>]
DESCRIPTION
This function compress input folders and upload them to Azure Blob Storage. It supports 7z and zip compression
algorithms.
It has also diff backup feature. This feature can only be used with 7z compression.
PARAMETERS
-OutputFolder <String>
Specifies the output folder for compressed backups
Required? true
Position? 1
Default value
Accept pipeline input? false
Accept wildcard characters? false
-InputFolders <Object>
Input folders for backup. It must be specified in "Name/Value" dictionary type. Ex: @{"Folder1"="C:\\Folder1",
"Folder2"="C:\\Folder2"}
Required? true
Position? 2
Default value @{}
Accept pipeline input? false
Accept wildcard characters? false
-DiffBackup [<SwitchParameter>]
Specifies only differential backup will be made. This option requires "7z" archive format and an full backup
had to made first.
Required? false
Position? named
Default value False
Accept pipeline input? false
Accept wildcard characters? false
-AZUpload [<SwitchParameter>]
Specifies if the compressed file upload to Azure Blob Storage or not.
Required? false
Position? named
Default value False
Accept pipeline input? false
Accept wildcard characters? false
-AZContainerName <String>
Specifies Azure Blob Storage container name. It will be generated, if it is omitted.
Required? false
Position? 3
Default value
Accept pipeline input? false
Accept wildcard characters? false
-AZContext <IStorageContext>
Specifies Azure Blob Storage account context. It can be generated, if Azure Context Autosave option is
enabled. (Enable-AzureRmContextAutosave)
Required? false
Position? 4
Default value
Accept pipeline input? false
Accept wildcard characters? false
-AZResourceGroupName <String>
Specifies Azure Blob Storage resource group name. If AZContext parameter is specified, It can be omitted.
Required? false
Position? 5
Default value
Accept pipeline input? false
Accept wildcard characters? false
-AZStorageAccountName <String>
Specifies Azure Blob Storage account name. If AZContext parameter is specified, It can be omitted.
Required? false
Position? 6
Default value
Accept pipeline input? false
Accept wildcard characters? false
-AZAcquireLease [<SwitchParameter>]
Specifies Azure Blob Storage leasing will be acquired after upload.
Required? false
Position? named
Default value False
Accept pipeline input? false
Accept wildcard characters? false
-Force [<SwitchParameter>]
Specifies previous backup for the same folder will be deleted.
Required? false
Position? named
Default value False
Accept pipeline input? false
Accept wildcard characters? false
-ArchiveFormat <String>
Specifies the archive format. Possible options are "7z" and "zip". Default option is "7z". 7z setup has to be
installed.
Required? false
Position? 7
Default value 7z
Accept pipeline input? false
Accept wildcard characters? false
-SevenZPath <String>
Specifies the 7z executable path. Default value is 'C:\\Program Files\\7-Zip\\7z.exe'
Required? false
Position? 8
Default value C:\\Program Files\\7-Zip\\7z.exe
Accept pipeline input? false
Accept wildcard characters? false
-SevenZUpdateSwitch <String>
Specifies the 7z differential backup switches. Default value is '-up0q0r2x2y2z0w2!'
Required? false
Position? 9
Default value -up0q0r2x2y2z0w2!
Accept pipeline input? false
Accept wildcard characters? false
-LogFile <String>
Log file for log output. Default value is 'azblobbackup.log
Required? false
Position? 10
Default value "$PSScriptRoot\\azblobbackup.log"
Accept pipeline input? false
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
None
OUTPUTS
None
-------------------------- EXAMPLE 1 --------------------------
C:\\PS>AZBlobBackup -OutputFolder C:\\Backup -InputFolders @{"Test"="C:\\Test"}
-------------------------- EXAMPLE 2 --------------------------
C:\\PS>AZBlobBackup -OutputFolder C:\\Backup -InputFolders @{"Test"="C:\\Test"} -AZUpload -AZResourceGroupName
StorageResGroup -AZAcquireLease
-AZStorageAccountName TestStorageAccount -Force
-------------------------- EXAMPLE 3 --------------------------
C:\\PS>AZBlobBackup -OutputFolder C:\\Backup -InputFolders @{"Test"="C:\\Test"} -AZUpload -AZResourceGroupName
StorageResGroup -AZAcquireLease
-AZStorageAccountName TestStorageAccount -DiffBackup
-------------------------- EXAMPLE 4 --------------------------
C:\\PS>AZBlobBackup -OutputFolder C:\\Backup -InputFolders @{"Test"="C:\\Test"} -ArchiveFormat zip
RELATED LINKS
https://github.com/alatas/AZPowershellTools
SYNOPSIS
Compress folders and upload them to Azure Blob Storage.
SYNTAX
AZBlobBackup [-OutputFolder] <String> [-InputFolders] <Object> [-DiffBackup] [-AZUpload] [[-AZContainerName]
<String>] [[-AZContext] <IStorageContext>] [[-AZResourceGroupName] <String>] [[-AZStorageAccountName] <String>]
[-AZAcquireLease] [-Force] [[-ArchiveFormat] <String>] [[-SevenZPath] <String>] [[-SevenZUpdateSwitch] <String>]
[[-LogFile] <String>] [<CommonParameters>]
DESCRIPTION
This function compress input folders and upload them to Azure Blob Storage. It supports 7z and zip compression
algorithms.
It has also diff backup feature. This feature can only be used with 7z compression.
PARAMETERS
-OutputFolder <String>
Specifies the output folder for compressed backups
Required? true
Position? 1
Default value
Accept pipeline input? false
Accept wildcard characters? false
-InputFolders <Object>
Input folders for backup. It must be specified in "Name/Value" dictionary type. Ex: @{"Folder1"="C:\\Folder1",
"Folder2"="C:\\Folder2"}
Required? true
Position? 2
Default value @{}
Accept pipeline input? false
Accept wildcard characters? false
-DiffBackup [<SwitchParameter>]
Specifies only differential backup will be made. This option requires "7z" archive format and an full backup
had to made first.
Required? false
Position? named
Default value False
Accept pipeline input? false
Accept wildcard characters? false
-AZUpload [<SwitchParameter>]
Specifies if the compressed file upload to Azure Blob Storage or not.
Required? false
Position? named
Default value False
Accept pipeline input? false
Accept wildcard characters? false
-AZContainerName <String>
Specifies Azure Blob Storage container name. It will be generated, if it is omitted.
Required? false
Position? 3
Default value
Accept pipeline input? false
Accept wildcard characters? false
-AZContext <IStorageContext>
Specifies Azure Blob Storage account context. It can be generated, if Azure Context Autosave option is
enabled. (Enable-AzureRmContextAutosave)
Required? false
Position? 4
Default value
Accept pipeline input? false
Accept wildcard characters? false
-AZResourceGroupName <String>
Specifies Azure Blob Storage resource group name. If AZContext parameter is specified, It can be omitted.
Required? false
Position? 5
Default value
Accept pipeline input? false
Accept wildcard characters? false
-AZStorageAccountName <String>
Specifies Azure Blob Storage account name. If AZContext parameter is specified, It can be omitted.
Required? false
Position? 6
Default value
Accept pipeline input? false
Accept wildcard characters? false
-AZAcquireLease [<SwitchParameter>]
Specifies Azure Blob Storage leasing will be acquired after upload.
Required? false
Position? named
Default value False
Accept pipeline input? false
Accept wildcard characters? false
-Force [<SwitchParameter>]
Specifies previous backup for the same folder will be deleted.
Required? false
Position? named
Default value False
Accept pipeline input? false
Accept wildcard characters? false
-ArchiveFormat <String>
Specifies the archive format. Possible options are "7z" and "zip". Default option is "7z". 7z setup has to be
installed.
Required? false
Position? 7
Default value 7z
Accept pipeline input? false
Accept wildcard characters? false
-SevenZPath <String>
Specifies the 7z executable path. Default value is 'C:\\Program Files\\7-Zip\\7z.exe'
Required? false
Position? 8
Default value C:\\Program Files\\7-Zip\\7z.exe
Accept pipeline input? false
Accept wildcard characters? false
-SevenZUpdateSwitch <String>
Specifies the 7z differential backup switches. Default value is '-up0q0r2x2y2z0w2!'
Required? false
Position? 9
Default value -up0q0r2x2y2z0w2!
Accept pipeline input? false
Accept wildcard characters? false
-LogFile <String>
Log file for log output. Default value is 'azblobbackup.log
Required? false
Position? 10
Default value "$PSScriptRoot\\azblobbackup.log"
Accept pipeline input? false
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
None
OUTPUTS
None
-------------------------- EXAMPLE 1 --------------------------
C:\\PS>AZBlobBackup -OutputFolder C:\\Backup -InputFolders @{"Test"="C:\\Test"}
-------------------------- EXAMPLE 2 --------------------------
C:\\PS>AZBlobBackup -OutputFolder C:\\Backup -InputFolders @{"Test"="C:\\Test"} -AZUpload -AZResourceGroupName
StorageResGroup -AZAcquireLease
-AZStorageAccountName TestStorageAccount -Force
-------------------------- EXAMPLE 3 --------------------------
C:\\PS>AZBlobBackup -OutputFolder C:\\Backup -InputFolders @{"Test"="C:\\Test"} -AZUpload -AZResourceGroupName
StorageResGroup -AZAcquireLease
-AZStorageAccountName TestStorageAccount -DiffBackup
-------------------------- EXAMPLE 4 --------------------------
C:\\PS>AZBlobBackup -OutputFolder C:\\Backup -InputFolders @{"Test"="C:\\Test"} -ArchiveFormat zip
RELATED LINKS
https://github.com/alatas/AZPowershellTools