Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

webui: Backup Unit Report fixes #1698

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ and since Bareos version 20 this project adheres to [Semantic Versioning](https:
- Make BareosDirPluginPrometheusExporter.py work with python3 [PR #1679]
- Improve FreeBSD dependencies [PR #1680]
- python-bareos: integrate usage of config files [PR #1690]
- webui: Backup Unit Report fixes [PR #1698]

## [23.0.1] - 2024-01-17

Expand Down Expand Up @@ -399,4 +400,5 @@ and since Bareos version 20 this project adheres to [Semantic Versioning](https:
[PR #1680]: https://github.com/bareos/bareos/pull/1680
[PR #1690]: https://github.com/bareos/bareos/pull/1690
[PR #1694]: https://github.com/bareos/bareos/pull/1694
[PR #1698]: https://github.com/bareos/bareos/pull/1698
[unreleased]: https://github.com/bareos/bareos/tree/master
26 changes: 16 additions & 10 deletions docs/manuals/source/TasksAndConcepts/BareosConsole.rst
Original file line number Diff line number Diff line change
Expand Up @@ -69,21 +69,21 @@ The maximum command line length is limited to 511 characters, so if you are scri
Exit the Console Program
~~~~~~~~~~~~~~~~~~~~~~~~

:index:`\ <single: Command; bconsole; exit>`\
.. index::
single: Command; bconsole; exit

Normally, you simply enter quit or exit and the Console program will terminate. However, it waits until the Director acknowledges the command. If the Director is already doing a lengthy command (e.g. prune), it may take some time. If you want to immediately terminate the Console program, enter the .quit command.

There is currently no way to interrupt a Console command once issued (i.e. Ctrl-C does not work). However, if you are at a prompt that is asking you to select one of several possibilities and you would like to abort the command, you can enter a period (.), and in most cases, you will either be returned to the main command prompt or if appropriate the previous prompt (in the case of nested prompts). In a few places such as where it is asking for a Volume name, the period will be taken to be the
Volume name. In that case, you will most likely be able to cancel at the next prompt.

Running the Console from a Shell Script
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

:index:`\ <single: Console; Running from a Shell>`\

.. _scripting:

Running the Console from a Shell Script
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. index::
single: Console; Running from a Shell

You can automate many Console tasks by running the console program from a shell script. For example, if you have created a file containing the following commands:

Expand Down Expand Up @@ -1324,8 +1324,13 @@ status scheduler
days=number
of days shows only the number of days in the scheduler preview. Positive numbers show the future, negative numbers show the past. days can be combined with the other selection criteria. days= can be combined with the other selection criteria.


.. _status-subscription:

status subscriptions
In case you have a service contract for Bareos, the command :bcommand:`status subscriptions` can help you to keep the overview over the subscriptions that are used.
In case you have a service contract for Bareos,
the command :bcommand:`status subscriptions` (:sinceVersion:`21: status subscriptions`)
can help you to keep the overview over the subscriptions that are used.

Using the console command :bcommand:`status subscriptions`, the status of the subscriptions can be checked any time interactively:

Expand Down Expand Up @@ -1412,12 +1417,13 @@ time
trace
:index:`\ <single: Console; Command; trace>`\ Turn on/off trace to file.

truncate
:index:`\ <single: Console; Command; truncate>`\ :index:`\ <single: Disk; Freeing disk space>`\ :index:`\ <single: Disk; Freeing disk space>`\

.. _bcommandTruncate:


truncate
.. index::
single: Console; Command; truncate
single: Disk; Freeing disk space

If the status of a volume is **Purged**, it normally still contains data, even so it can not easily be accessed.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* bareos-webui - Bareos Web-Frontend
*
* @link https://github.com/bareos/bareos for the canonical source repository
* @copyright Copyright (C) 2013-2023 Bareos GmbH & Co. KG (http://www.bareos.org/)
* @copyright Copyright (C) 2013-2024 Bareos GmbH & Co. KG (http://www.bareos.org/)
* @license GNU Affero General Public License (http://www.gnu.org/licenses/)
*
* This program is free software: you can redistribute it and/or modify
Expand Down Expand Up @@ -185,7 +185,8 @@ public function backupunitreportAction()
$response->getHeaders()->addHeaderLine('Content-Disposition', 'attachment; filename="bareos-backup-unit-report.json"');

if (isset($result)) {
$response->setContent(JSON::prettyPrint(JSON::encode($result)));
$json_backupunitreport = json_encode($result, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT);
$response->setContent($json_backupunitreport);
}

return $response;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* bareos-webui - Bareos Web-Frontend
*
* @link https://github.com/bareos/bareos for the canonical source repository
* @copyright Copyright (C) 2022-2023 Bareos GmbH & Co. KG (http://www.bareos.org/)
* @copyright Copyright (C) 2022-2024 Bareos GmbH & Co. KG (http://www.bareos.org/)
* @license GNU Affero General Public License (http://www.gnu.org/licenses/)
*
* This program is free software: you can redistribute it and/or modify
Expand Down Expand Up @@ -101,9 +101,9 @@ Please request a quote by sending the report via email to <a href="mailto:sales@
</div>

<?php
if ($this->directorOutput) {
echo '<a class="btn btn-primary" href="/director/backupunitreport">Download Backup Unit Report (JSON)</a>';
}
if ($this->directorOutput) {
echo '<a class="btn btn-primary" href="' . $this->url('director', array('action' => 'backupunitreport')) . '">' . $this->translate('Download Backup Unit Report (JSON)') . '</a>';
}
?>

<?php endif; ?>