Quality of life things.
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
Build and test / requirements (push) Failing after 3m48s

This commit is contained in:
2024-02-07 11:00:08 +00:00
parent aed385f5e0
commit 6ce774236e
18 changed files with 226 additions and 1885 deletions

View File

@@ -65,19 +65,25 @@ class CommandBackup extends Command
$rclone = new Rclone($app->getLogger()->withName('rclone'), (string)$app->getConfig('rclone.path'));
$notification = new Notification();
/** @var array<array-key,array<string,string>> */
/**
* @var array<array-key,array<string,string>>
*/
$notificationConfig = $app->getConfig('notification');
$notification->loadMany($notificationConfig);
/** @var array<string,string> */
/**
* @var array<string,string>
*/
$templateConfig = $app->getConfig('templates');
$render = new Twig($templateConfig);
/** @var array{title: string, source: string, destination: string}[] */
/**
* @var array{title: string, source: string, destination: string}[]
*/
$backupElements = $app->getConfig('backup');
foreach ($sioProgressbar->progressIterate($backupElements) as $conf) {
$title = $conf['title'];
$template = array();
$template = [];
$template['config'] = $conf;
try {
$template['start'] = new DateTime();
@@ -85,7 +91,9 @@ class CommandBackup extends Command
$template['rclone_version'] = $rclone->getVersion();
$template['destination_size_before'] = $rclone->getSize($conf['destination']);
/** @var array<array-key, string> */
/**
* @var array<array-key, string>
*/
$rcloneOptions = $app->getConfig('rclone.options');
$rclone->copy($conf['source'], $conf['destination'], $rcloneOptions);