From 3e9138e05a0407c9690db3ab23b180479bab4ee5 Mon Sep 17 00:00:00 2001 From: Andrew Date: Sun, 12 Feb 2023 08:29:55 -0600 Subject: [PATCH] fix for remote host ports --- .goreleaser.yaml | 2 +- examples/backy.yaml | 1 + pkg/backy/ssh.go | 3 +++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 9932f49..7acf28a 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -16,7 +16,7 @@ builds: - arm64 archives: - - format: binary + - format: tar.gz # this name template makes the OS and Arch compatible with the results of uname. name_template: >- {{ .ProjectName }} diff --git a/examples/backy.yaml b/examples/backy.yaml index 6ea27cd..7a5f61e 100644 --- a/examples/backy.yaml +++ b/examples/backy.yaml @@ -33,6 +33,7 @@ cmd-configs: notifications: - matrix name: backup-some-server + cron: "0 0 1 * * *" hostname: name: hostname order: diff --git a/pkg/backy/ssh.go b/pkg/backy/ssh.go index 07a2321..874a701 100644 --- a/pkg/backy/ssh.go +++ b/pkg/backy/ssh.go @@ -209,6 +209,9 @@ func (remoteHost *Host) GetPort() { } func (remoteHost *Host) CombineHostNameWithPort() { + if remoteHost.HostName == fmt.Sprintf("%s:%v", remoteHost.HostName, remoteHost.Port) { + return + } remoteHost.HostName = fmt.Sprintf("%s:%v", remoteHost.HostName, remoteHost.Port) }