change box addr for zfs send
This commit is contained in:
parent
8a6fced9c8
commit
f36e7da824
6
app.go
6
app.go
@ -604,7 +604,7 @@ func (a AppConfig) SendSnapshots() (err error) {
|
||||
if *debugFlag {
|
||||
log.Printf("AppConfig.SendSnapshots : %s : Initializing snapshot on %s from %s", a.Name, dest.Box(), string(sFirstSnapshot))
|
||||
}
|
||||
_, err = cfg.Box[dest.Box()].SSHExec("ssh " + cfg.Box[src.Box()].User + "@" + src.Box() + " zfs send " + string(sFirstSnapshot) + " | zfs recv -F " + dest.Path() + "/" + src.Box() + "/" + src.Path())
|
||||
_, err = cfg.Box[dest.Box()].SSHExec("ssh " + cfg.Box[src.Box()].User + "@" + cfg.Box[src.Box()].Host() + " zfs send " + string(sFirstSnapshot) + " | zfs recv -F " + dest.Path() + "/" + src.Box() + "/" + src.Path())
|
||||
if err != nil {
|
||||
if *debugFlag {
|
||||
log.Printf("AppConfig.SendSnapshots : %s : Initializing snapshot on %s from %s failed (%s)", a.Name, dest.Box(), string(sFirstSnapshot), err)
|
||||
@ -627,7 +627,7 @@ func (a AppConfig) SendSnapshots() (err error) {
|
||||
if err != nil && err.Error() != "no snapshot" {
|
||||
return
|
||||
}
|
||||
_, err = cfg.Box[dest.Box()].SSHExec("ssh " + cfg.Box[src.Box()].User + "@" + src.Box() + " zfs send -I " + string(sCurrSnapshot) + " " + string(sNextSnapshot) + " | zfs recv -F " + dest.Path() + "/" + src.Box() + "/" + src.Path())
|
||||
_, err = cfg.Box[dest.Box()].SSHExec("ssh " + cfg.Box[src.Box()].User + "@" + cfg.Box[src.Box()].Host() + " zfs send -I " + string(sCurrSnapshot) + " " + string(sNextSnapshot) + " | zfs recv -F " + dest.Path() + "/" + src.Box() + "/" + src.Path())
|
||||
if err != nil {
|
||||
if *debugFlag {
|
||||
log.Printf("AppConfig.SendSnapshots : %s : Sending snapshot on %s from %s failed (%s)", a.Name, dest.Box(), string(sNextSnapshot), err)
|
||||
@ -658,7 +658,7 @@ func (a AppConfig) SendSnapshots() (err error) {
|
||||
if err != nil && err.Error() != "no snapshot" {
|
||||
return
|
||||
}
|
||||
_, err = cfg.Box[dest.Box()].SSHExec("ssh " + cfg.Box[src.Box()].User + "@" + src.Box() + " zfs send -I " + string(sCurrSnapshot) + " " + string(sNextSnapshot) + " | zfs recv -F " + dest.Path() + "/" + src.Box() + "/" + src.Path())
|
||||
_, err = cfg.Box[dest.Box()].SSHExec("ssh " + cfg.Box[src.Box()].User + "@" + cfg.Box[src.Box()].Host() + " zfs send -I " + string(sCurrSnapshot) + " " + string(sNextSnapshot) + " | zfs recv -F " + dest.Path() + "/" + src.Box() + "/" + src.Path())
|
||||
if err != nil {
|
||||
if *debugFlag {
|
||||
log.Printf("AppConfig.SendSnapshots : %s : Sending snapshot on %s from %s failed (%s)", a.Name, dest.Box(), string(sNextSnapshot), err)
|
||||
|
5
box.go
5
box.go
@ -416,3 +416,8 @@ func (b *Box) SSHExec(cmd string) (buf *bytes.Buffer, err error) {
|
||||
buf, err = b.ssh.exec(cmd)
|
||||
return
|
||||
}
|
||||
|
||||
func (b *Box) Host() string {
|
||||
s := strings.Split(string(b.Addr), `:`)
|
||||
return s[0]
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Code generated by version.sh (@generated) DO NOT EDIT.
|
||||
package main
|
||||
var githash = "fcc9fa3"
|
||||
var buildstamp = "2022-06-19_04:33:26"
|
||||
var commits = "50"
|
||||
var version = "fcc9fa3-b50 - 2022-06-19_04:33:26"
|
||||
var githash = "8a6fced"
|
||||
var buildstamp = "2022-09-07_14:20:27"
|
||||
var commits = "51"
|
||||
var version = "8a6fced-b51 - 2022-09-07_14:20:27"
|
||||
|
Loading…
Reference in New Issue
Block a user