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