mirror of
https://github.com/jkaninda/mysql-bkup.git
synced 2025-12-06 13:39:41 +01:00
Fix log
This commit is contained in:
10
pkg/scp.go
10
pkg/scp.go
@@ -21,7 +21,7 @@ func CopyToRemote(fileName, remotePath string) error {
|
|||||||
|
|
||||||
err := utils.CheckEnvVars(sshHVars)
|
err := utils.CheckEnvVars(sshHVars)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
utils.Error("Error checking environment variables\n: %s", err)
|
utils.Error("Error checking environment variables: %s", err)
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -31,9 +31,9 @@ func CopyToRemote(fileName, remotePath string) error {
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
if sshPassword == "" {
|
if sshPassword == "" {
|
||||||
return errors.New("SSH_PASSWORD environment variable is required if SSH_IDENTIFY_FILE is empty\n")
|
return errors.New("SSH_PASSWORD environment variable is required if SSH_IDENTIFY_FILE is empty")
|
||||||
}
|
}
|
||||||
utils.Warn("Accessing the remote server using password, password is not recommended\n")
|
utils.Warn("Accessing the remote server using password, password is not recommended")
|
||||||
clientConfig, _ = auth.PasswordKey(sshUser, sshPassword, ssh.InsecureIgnoreHostKey())
|
clientConfig, _ = auth.PasswordKey(sshUser, sshPassword, ssh.InsecureIgnoreHostKey())
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -43,7 +43,7 @@ func CopyToRemote(fileName, remotePath string) error {
|
|||||||
// Connect to the remote server
|
// Connect to the remote server
|
||||||
err = client.Connect()
|
err = client.Connect()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.New("Couldn't establish a connection to the remote server\n")
|
return errors.New("Couldn't establish a connection to the remote server")
|
||||||
}
|
}
|
||||||
|
|
||||||
// Open a file
|
// Open a file
|
||||||
@@ -83,7 +83,7 @@ func CopyFromRemote(fileName, remotePath string) error {
|
|||||||
if sshPassword == "" {
|
if sshPassword == "" {
|
||||||
return errors.New("SSH_PASSWORD environment variable is required if SSH_IDENTIFY_FILE is empty\n")
|
return errors.New("SSH_PASSWORD environment variable is required if SSH_IDENTIFY_FILE is empty\n")
|
||||||
}
|
}
|
||||||
utils.Warn("Accessing the remote server using password, password is not recommended\n")
|
utils.Warn("Accessing the remote server using password, password is not recommended")
|
||||||
clientConfig, _ = auth.PasswordKey(sshUser, sshPassword, ssh.InsecureIgnoreHostKey())
|
clientConfig, _ = auth.PasswordKey(sshUser, sshPassword, ssh.InsecureIgnoreHostKey())
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -111,7 +111,7 @@ func TestDatabaseConnection() {
|
|||||||
cmd.Stderr = &out
|
cmd.Stderr = &out
|
||||||
err := cmd.Run()
|
err := cmd.Run()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
Error(fmt.Sprintf("Error testing database connection: %v\nOutput: %s\n", err, out.String()))
|
Error("Error testing database connection: %v\nOutput: %s", err, out.String())
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -157,7 +157,7 @@ func GetEnvVariable(envName, oldEnvName string) string {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return value
|
return value
|
||||||
}
|
}
|
||||||
Warn("%s is deprecated, please use %s instead!\n", oldEnvName, envName)
|
Warn("%s is deprecated, please use %s instead!", oldEnvName, envName)
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user