mirror of
https://github.com/jkaninda/mysql-bkup.git
synced 2025-12-06 21:49:40 +01:00
chore: add storage type alt for smallcase and uppercase
This commit is contained in:
@@ -75,11 +75,11 @@ func BackupTask(db *dbConfig, config *BackupConfig) {
|
||||
switch config.storage {
|
||||
case "local":
|
||||
localBackup(db, config)
|
||||
case "s3":
|
||||
case "s3", "S3":
|
||||
s3Backup(db, config)
|
||||
case "ssh", "remote":
|
||||
case "ssh", "SSH", "remote":
|
||||
sshBackup(db, config)
|
||||
case "ftp":
|
||||
case "ftp", "FTP":
|
||||
ftpBackup(db, config)
|
||||
default:
|
||||
localBackup(db, config)
|
||||
|
||||
@@ -21,15 +21,15 @@ func StartRestore(cmd *cobra.Command) {
|
||||
restoreConf := initRestoreConfig(cmd)
|
||||
|
||||
switch restoreConf.storage {
|
||||
case "s3":
|
||||
restoreFromS3(dbConf, restoreConf.file, restoreConf.bucket, restoreConf.s3Path)
|
||||
case "local":
|
||||
utils.Info("Restore database from local")
|
||||
copyToTmp(storagePath, restoreConf.file)
|
||||
RestoreDatabase(dbConf, restoreConf.file)
|
||||
case "ssh":
|
||||
case "s3", "S3":
|
||||
restoreFromS3(dbConf, restoreConf.file, restoreConf.bucket, restoreConf.s3Path)
|
||||
case "ssh", "SSH":
|
||||
restoreFromRemote(dbConf, restoreConf.file, restoreConf.remotePath)
|
||||
case "ftp":
|
||||
case "ftp", "FTP":
|
||||
restoreFromFTP(dbConf, restoreConf.file, restoreConf.remotePath)
|
||||
default:
|
||||
utils.Info("Restore database from local")
|
||||
|
||||
Reference in New Issue
Block a user