no bin path

This commit is contained in:
shoopea 2021-11-04 20:18:18 +08:00
parent 6d96bece95
commit f17039d370

8
ssh.go
View File

@ -112,7 +112,7 @@ func (s *SSHConfig) getSnapshotList() error {
var b bytes.Buffer var b bytes.Buffer
session.Stdout = &b session.Stdout = &b
err = session.Run("TZ=\"" + cfg.Timezone + "\" /usr/sbin/zfs list -H -t snapshot -o name") err = session.Run("TZ=\"" + cfg.Timezone + "\" zfs list -H -t snapshot -o name")
if err != nil { if err != nil {
if *debugFlag { if *debugFlag {
log.Printf("SSHConfig.getSnapshotList : %s : session.Run() : %s", s.name, err) log.Printf("SSHConfig.getSnapshotList : %s : session.Run() : %s", s.name, err)
@ -166,7 +166,7 @@ func (s *SSHConfig) getZFSList() error {
var b bytes.Buffer var b bytes.Buffer
session.Stdout = &b session.Stdout = &b
err = session.Run("TZ=\"" + cfg.Timezone + "\" /sbin/zfs list -H -o name,mountpoint") err = session.Run("TZ=\"" + cfg.Timezone + "\" zfs list -H -o name,mountpoint")
if err != nil { if err != nil {
if *debugFlag { if *debugFlag {
log.Printf("SSHConfig.getZFSList : %s : session.Run() : %s", s.name, err) log.Printf("SSHConfig.getZFSList : %s : session.Run() : %s", s.name, err)
@ -238,7 +238,7 @@ func (s *SSHConfig) getTime() error {
var b bytes.Buffer var b bytes.Buffer
session.Stdout = &b session.Stdout = &b
err = session.Run("TZ=\"" + cfg.Timezone + "\" /usr/bin/date +\"%F %T\"") err = session.Run("TZ=\"" + cfg.Timezone + "\" date +\"%F %T\"")
if err != nil { if err != nil {
if *debugFlag { if *debugFlag {
log.Printf("SSHConfig.getTime : %s : session.Run() : %s", s.name, err) log.Printf("SSHConfig.getTime : %s : session.Run() : %s", s.name, err)
@ -317,7 +317,7 @@ func (s *SSHConfig) createZFS(path string) error {
log.Printf("SSHConfig.createZFS : Creating %s:%s", s.name, base) log.Printf("SSHConfig.createZFS : Creating %s:%s", s.name, base)
} }
err := s.exec("/sbin/zfs create -o mountpoint=none " + base) err := s.exec("zfs create -o mountpoint=none " + base)
if err != nil { if err != nil {
if *debugFlag { if *debugFlag {
log.Printf("SSHConfig.createZFS : s.exec(%s) : %s", s.name, err) log.Printf("SSHConfig.createZFS : s.exec(%s) : %s", s.name, err)