mirror of
https://github.com/jkaninda/mysql-bkup.git
synced 2026-11-13 16:47:14 +00:00
chore: add storage type alt for smallcase and uppercase
This commit is contained in:
1 parent
d774584f64
commit
a4ad0502cf
2 files changed
+7
-7
No files matched your search
+3
-3
@@ -75,11 +75,11 @@ func BackupTask(db *dbConfig, config *BackupConfig) {
|
|||||||
switch config.storage {
|
switch config.storage {
|
||||||
case "local":
|
case "local":
|
||||||
localBackup(db, config)
|
localBackup(db, config)
|
||||||
case "s3":
|
case "s3", "S3":
|
||||||
s3Backup(db, config)
|
s3Backup(db, config)
|
||||||
case "ssh", "remote":
|
case "ssh", "SSH", "remote":
|
||||||
sshBackup(db, config)
|
sshBackup(db, config)
|
||||||
case "ftp":
|
case "ftp", "FTP":
|
||||||
ftpBackup(db, config)
|
ftpBackup(db, config)
|
||||||
default:
|
default:
|
||||||
localBackup(db, config)
|
localBackup(db, config)
|
||||||
|
|||||||
+4
-4
@@ -21,15 +21,15 @@ func StartRestore(cmd *cobra.Command) {
|
|||||||
restoreConf := initRestoreConfig(cmd)
|
restoreConf := initRestoreConfig(cmd)
|
||||||
|
|
||||||
switch restoreConf.storage {
|
switch restoreConf.storage {
|
||||||
case "s3":
|
|
||||||
restoreFromS3(dbConf, restoreConf.file, restoreConf.bucket, restoreConf.s3Path)
|
|
||||||
case "local":
|
case "local":
|
||||||
utils.Info("Restore database from local")
|
utils.Info("Restore database from local")
|
||||||
copyToTmp(storagePath, restoreConf.file)
|
copyToTmp(storagePath, restoreConf.file)
|
||||||
RestoreDatabase(dbConf, 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)
|
restoreFromRemote(dbConf, restoreConf.file, restoreConf.remotePath)
|
||||||
case "ftp":
|
case "ftp", "FTP":
|
||||||
restoreFromFTP(dbConf, restoreConf.file, restoreConf.remotePath)
|
restoreFromFTP(dbConf, restoreConf.file, restoreConf.remotePath)
|
||||||
default:
|
default:
|
||||||
utils.Info("Restore database from local")
|
utils.Info("Restore database from local")
|
||||||
|
|||||||
Reference in new issue
Block a user