perf:数据库备份
This commit is contained in:
@@ -43,7 +43,7 @@ public class DbBackupConfig {
|
||||
try {
|
||||
String saveFile = StrUtil.format("{}{}/{}.sql.gz", getPath(), dbName, DateUtil.format(new Date(), format));
|
||||
FileUtil.mkParentDirs(saveFile);
|
||||
String cmd = StrUtil.format("mysqldump -u {} -p{} -h 127.0.0.1 {} | gzip > {}", username, password, dbName, saveFile);
|
||||
String cmd = StrUtil.format("mysqldump -u {} --password={} -h 127.0.0.1 {} | gzip > {}", username, password, dbName, saveFile);
|
||||
LogFactory.get().info("cmd: " + cmd);
|
||||
String forStr = RuntimeUtil.execForStr(cmd);
|
||||
LogFactory.get().info("dbBackup: " + forStr);
|
||||
|
||||
Reference in New Issue
Block a user