Skip to content
Snippets Groups Projects
Commit ddde03b5 authored by jurgenhaas's avatar jurgenhaas
Browse files

Fix cron config

parent 21d1cd9a
No related branches found
No related tags found
1 merge request!9Merging develop into main
Pipeline #522007 passed
......@@ -251,7 +251,10 @@ class Handler extends BaseHandler {
$traefik['ports'] = 443;
$crontabs = $this->config->readValue('crontabs');
if ($this->config->readValue(['backup', 'enable'])) {
$crontabs['www-data'][] = '5 0 * * * cd /var/www/html && /usr/local/bin/drush sql:dump --result-file=/var/backups/mysql/drupal.sql';
$crontabs['www-data']['MySQL backup'] = [
'schedule' => '5 0 * * *',
'command' => 'cd /var/www/html && /usr/local/bin/drush sql:dump --result-file=/var/backups/mysql/drupal.sql',
];
}
$crontabs['enable'] = (array_sum(array_map('count', $crontabs)) > 0);
$this->config->setValue('crontabs', $crontabs, FALSE);
......@@ -543,11 +546,12 @@ class Handler extends BaseHandler {
continue;
}
$activeTasks = [];
foreach ($tasks as $task) {
foreach ($tasks as $name => $task) {
$disabled = !empty($task['disabled']);
$command = $task['command'];
if (isset($hj_manager)) {
unset($task['disabled'], $task['command']);
$task['name'] = $name;
$task['channels'] = $hj_api_channels;
$task['tags'] = implode(' ', ['d4d', $hj_project, $hj_branch]);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment