[mod] serialization:postgresql_dump:password backup file
This commit is contained in:
parent
29902615aa
commit
d116b4c04c
|
|
@ -42,6 +42,16 @@ namespace _mimir.serialization.postgresql_dump
|
||||||
{
|
{
|
||||||
const result : Array<string> = [];
|
const result : Array<string> = [];
|
||||||
const password_file_path : string = "${HOME}/.pgpass";
|
const password_file_path : string = "${HOME}/.pgpass";
|
||||||
|
const password_file_backup_path : string = (password_file_path + ".bak");
|
||||||
|
result.push(
|
||||||
|
lib_plankton.string.coin(
|
||||||
|
"test -f {{path_regular}} && cp {{path_regular}} {{path_backup}}",
|
||||||
|
{
|
||||||
|
"path_regular": password_file_path,
|
||||||
|
"path_backup": password_file_backup_path,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
);
|
||||||
result.push(
|
result.push(
|
||||||
lib_plankton.string.coin(
|
lib_plankton.string.coin(
|
||||||
"echo '{{host}}:{{port}}:{{schema}}:{{username}}:{{password}}' > {{path}} && chmod 0600 {{path}}",
|
"echo '{{host}}:{{port}}:{{schema}}:{{username}}:{{password}}' > {{path}} && chmod 0600 {{path}}",
|
||||||
|
|
@ -85,6 +95,15 @@ namespace _mimir.serialization.postgresql_dump
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
result.push(
|
||||||
|
lib_plankton.string.coin(
|
||||||
|
"test -f {{path_backup}} && mv {{path_backup}} {{path_regular}}",
|
||||||
|
{
|
||||||
|
"path_regular": password_file_path,
|
||||||
|
"path_backup": password_file_backup_path,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue