mirror of
https://github.com/jkaninda/mysql-bkup.git
synced 2025-12-07 14:09:41 +01:00
feat: replace --operation flag by backup and restore command
This commit is contained in:
@@ -11,9 +11,6 @@ import (
|
||||
"os/exec"
|
||||
)
|
||||
|
||||
const s3MountPath string = "/s3mnt"
|
||||
const s3fsPasswdFile string = "/etc/passwd-s3fs"
|
||||
|
||||
var (
|
||||
accessKey = ""
|
||||
secretKey = ""
|
||||
@@ -21,6 +18,10 @@ var (
|
||||
s3Endpoint = ""
|
||||
)
|
||||
|
||||
func S3Mount() {
|
||||
MountS3Storage(s3Path)
|
||||
}
|
||||
|
||||
// MountS3Storage Mount s3 storage using s3fs
|
||||
func MountS3Storage(s3Path string) {
|
||||
accessKey = os.Getenv("ACCESS_KEY")
|
||||
@@ -46,7 +47,7 @@ func MountS3Storage(s3Path string) {
|
||||
utils.ChangePermission(s3fsPasswdFile, 0600)
|
||||
|
||||
//Mount object storage
|
||||
utils.Info("Mounting Object storage in", s3MountPath)
|
||||
utils.Info("Mounting Object storage in ", s3MountPath)
|
||||
if isEmpty, _ := utils.IsDirEmpty(s3MountPath); isEmpty {
|
||||
cmd := exec.Command("s3fs", bucketName, s3MountPath,
|
||||
"-o", "passwd_file="+s3fsPasswdFile,
|
||||
|
||||
Reference in New Issue
Block a user