45 lines
693 B
TypeScript
45 lines
693 B
TypeScript
![]() |
namespace _mimir.transfer.borg
|
||
|
{
|
||
|
|
||
|
/**
|
||
|
*/
|
||
|
export function execute(
|
||
|
parameters : _mimir.conf.type_target_parameters_borg,
|
||
|
name : string,
|
||
|
stamp : string,
|
||
|
directory : string
|
||
|
) : Array<string>
|
||
|
{
|
||
|
const result : Array<string> = [];
|
||
|
result.push(
|
||
|
_mimir.helpers.borg.create(
|
||
|
parameters.repository,
|
||
|
lib_plankton.string.coin(
|
||
|
"{{stamp}}-{{name}}",
|
||
|
{
|
||
|
"name": name,
|
||
|
"stamp": stamp,
|
||
|
}
|
||
|
),
|
||
|
[directory],
|
||
|
{
|
||
|
"compression": parameters.compression,
|
||
|
}
|
||
|
)
|
||
|
);
|
||
|
result.push(
|
||
|
_mimir.helpers.borg.prune(
|
||
|
parameters.repository,
|
||
|
"2w",
|
||
|
{
|
||
|
"keep_weekly": 7,
|
||
|
"keep_yearly": 2,
|
||
|
}
|
||
|
)
|
||
|
);
|
||
|
return result;
|
||
|
}
|
||
|
|
||
|
}
|
||
|
|