feat: replace --operation flag by backup and restore command

This commit is contained in:
2024-01-20 13:04:39 +01:00
parent 4b07a78f29
commit 05eda4213a
22 changed files with 327 additions and 283 deletions

View File

@@ -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,