8 Commits
1.4 ... 1.4.1

Author SHA1 Message Date
Kevin Woley
e826c326b6 Merge pull request #42 from kmwoley/release_1_4_1
Release 1.4.1
2021-05-09 21:02:56 -07:00
Kevin Woley
58558a6a67 Update CHANGELOG.md
1.4.1 release notes.
2021-05-09 21:01:28 -07:00
Kevin Woley
0919914dac internet connection test fix for PowerShell 7.1
resolves #37
2021-05-09 20:35:06 -07:00
Kevin Woley
ca90934e51 improve URL parsing, allow disabling of internet check
fixes #38
2021-05-09 20:19:29 -07:00
Kevin Woley
e5cc051edf remove uneeded -replace parameter 2021-05-07 20:06:55 -07:00
tree3887
817e67c354 Update backup.ps1 (#36)
Adds double quotes around each path and removes a trailing backslash from them as well. I have found through experimentation that restic does not like a backslash followed by a double quote. The backslash appears to be an escape character.
Surrounding the path with double quotes allows paths with spaces to be used.
2021-05-07 19:47:59 -07:00
Kevin Woley
d7cc581e6f Merge pull request #35 from tensberg/restic-0.12
Update installer to install restic 0.12.0
2021-02-27 16:02:52 -08:00
Michael Koch
f0c357520e Update installer to install restic 0.12.0
This fixes the backup script's usage of features not available in the
previous version.
2021-02-27 12:26:40 +01:00
3 changed files with 30 additions and 8 deletions

View File

@@ -1,7 +1,19 @@
# Changelog
## [1.4.1](https://github.com/kmwoley/restic-windows-backup/tree/1.4.1) (2021-05-29)
[Full Changelog](https://github.com/kmwoley/restic-windows-backup/compare/1.4...1.4.1)
Bugfix release.
## Fixes
- Improved URL parsing so that the internet connectivity check works if the URL doesn't provide a protocol
- Add PowerShell 7.1 support to internet connectivity check
## Enhancements
- Setting $InternetTestAttempts to 0 will now bypass the internet connectivity checks entirely
## [1.4](https://github.com/kmwoley/restic-windows-backup/tree/1.4) (2021-02-24)
[Full Changelog](https://github.com/kmwoley/restic-windows-backup/compare/1.3...HEAD)
[Full Changelog](https://github.com/kmwoley/restic-windows-backup/compare/1.3...1.4)
Moved to using Restic's inbuilt filesystem shadow copy creation (VSS).

View File

@@ -140,7 +140,7 @@ function Invoke-Backup {
# Build the new list of folders from settings (if there are any)
$folder_list = New-Object System.Collections.Generic.List[System.Object]
ForEach ($path in $item.Value) {
$p = Join-Path $root_path $path
$p = '"{0}"' -f ((Join-Path $root_path $path) -replace "\\$")
$folder_list.Add($p)
}
@@ -209,9 +209,15 @@ function Send-Email {
function Invoke-ConnectivityCheck {
Param($SuccessLog, $ErrorLog)
if($InternetTestAttempts -le 0) {
Write-Output "[[Internet]] Internet connectivity check disabled. Skipping." | Tee-Object -Append $SuccessLog
return $true
}
# skip the internet connectivity check for local repos
if(Test-Path $env:RESTIC_REPOSITORY) {
Write-Output "[[Internet]] Skipping internet connectivity check." | Tee-Object -Append $SuccessLog
Write-Output "[[Internet]] Local repository. Skipping internet connectivity check." | Tee-Object -Append $SuccessLog
return $true
}
@@ -233,9 +239,13 @@ function Invoke-ConnectivityCheck {
}
else {
# parse connection string for hostname
# Uri parser doesn't handle leading connection type info (s3:, sftp:, rest:)
# Uri parser doesn't handle leading connection type info (s3:, sftp:, rest:)
$connection_string = $env:RESTIC_REPOSITORY -replace "^s3:" -replace "^sftp:" -replace "^rest:"
$repository_host = ([System.Uri]$connection_string).host
if(-not ($connection_string -match "://")) {
# Uri parser expects to have a protocol. Add 'https://' to make it parse correctly.
$connection_string = "https://" + $connection_string
}
$repository_host = ([System.Uri]$connection_string).DnsSafeHost
}
if([string]::IsNullOrEmpty($repository_host)) {
@@ -256,7 +266,7 @@ function Invoke-ConnectivityCheck {
Write-Output "[[Internet]] Waiting for internet connectivity... $sleep_count" | Tee-Object -Append $SuccessLog
Start-Sleep 30
}
elseif(!(Test-Connection -Server $repository_host -Quiet)) {
elseif(!(Test-Connection -ComputerName $repository_host -Quiet)) {
Write-Output "[[Internet]] Waiting for connection to repository ($repository_host)... $sleep_count" | Tee-Object -Append $SuccessLog
Start-Sleep 30
}

View File

@@ -5,10 +5,10 @@
if(-not (Test-Path $ResticExe)) {
$url = $null
if([Environment]::Is64BitOperatingSystem){
$url = "https://github.com/restic/restic/releases/download/v0.9.6/restic_0.9.6_windows_amd64.zip"
$url = "https://github.com/restic/restic/releases/download/v0.12.0/restic_0.12.0_windows_amd64.zip"
}
else {
$url = "https://github.com/restic/restic/releases/download/v0.9.6/restic_0.9.6_windows_386.zip"
$url = "https://github.com/restic/restic/releases/download/v0.12.0/restic_0.12.0_windows_386.zip"
}
$output = Join-Path $InstallPath "restic.zip"
Invoke-WebRequest -Uri $url -OutFile $output