Blame doc/automatic.rst

Packit 6f3914
..
Packit 6f3914
  Copyright (C) 2014-2018 Red Hat, Inc.
Packit 6f3914
Packit 6f3914
  This copyrighted material is made available to anyone wishing to use,
Packit 6f3914
  modify, copy, or redistribute it subject to the terms and conditions of
Packit 6f3914
  the GNU General Public License v.2, or (at your option) any later version.
Packit 6f3914
  This program is distributed in the hope that it will be useful, but WITHOUT
Packit 6f3914
  ANY WARRANTY expressed or implied, including the implied warranties of
Packit 6f3914
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General
Packit 6f3914
  Public License for more details.  You should have received a copy of the
Packit 6f3914
  GNU General Public License along with this program; if not, write to the
Packit 6f3914
  Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
Packit 6f3914
  02110-1301, USA.  Any Red Hat trademarks that are incorporated in the
Packit 6f3914
  source code or documentation are not subject to the GNU General Public
Packit 6f3914
  License and may only be used or replicated with the express permission of
Packit 6f3914
  Red Hat, Inc.
Packit 6f3914
Packit 6f3914
###############
Packit 6f3914
 DNF Automatic
Packit 6f3914
###############
Packit 6f3914
Packit 6f3914
==========
Packit 6f3914
 Synopsis
Packit 6f3914
==========
Packit 6f3914
Packit 6f3914
``dnf-automatic [<config file>]``
Packit 6f3914
Packit 6f3914
=============
Packit 6f3914
 Description
Packit 6f3914
=============
Packit 6f3914
Packit 6f3914
Alternative CLI to ``dnf upgrade`` with specific facilities to make it suitable to be executed automatically and regularly from systemd timers, cron jobs and similar.
Packit 6f3914
Packit 6f3914
The operation of the tool is usually controlled by the configuration file or the function-specific timer units (see below). The command only accepts a single optional argument pointing to the config file, and some control arguments intended for use by the services that back the timer units. If no configuration file is passed from the command line, ``/etc/dnf/automatic.conf`` is used.
Packit 6f3914
Packit 6f3914
The tool synchronizes package metadata as needed and then checks for updates available for the given system and then either exits, downloads the packages or downloads and applies the packages. The outcome of the operation is then reported by a selected mechanism, for instance via the standard output, email or MOTD messages.
Packit 6f3914
Packit 6f3914
The systemd timer unit ``dnf-automatic.timer`` will behave as the configuration file specifies (see below) with regard to whether to download and apply updates. Some other timer units are provided which override the configuration file with some standard behaviours:
Packit 6f3914
Packit 6f3914
- dnf-automatic-notifyonly
Packit 6f3914
- dnf-automatic-download
Packit 6f3914
- dnf-automatic-install
Packit 6f3914
Packit 6f3914
Regardless of the configuration file settings, the first will only notify of available updates. The second will download, but not install them. The third will download and install them.
Packit 6f3914
Packit 6f3914
===================
Packit 6f3914
 Run dnf-automatic
Packit 6f3914
===================
Packit 6f3914
Packit 6f3914
You can select one that most closely fits your needs, customize ``/etc/dnf/automatic.conf`` for any specific behaviors, and enable the timer unit.
Packit 6f3914
Packit 6f3914
For example: ``systemctl enable dnf-automatic-notifyonly.timer && systemctl start dnf-automatic-notifyonly.timer``
Packit 6f3914
Packit 6f3914
===========================
Packit 6f3914
 Configuration File Format
Packit 6f3914
===========================
Packit 6f3914
Packit 6f3914
The configuration file is separated into topical sections.
Packit 6f3914
Packit 6f3914
----------------------
Packit 6f3914
``[commands]`` section
Packit 6f3914
----------------------
Packit 6f3914
Packit 6f3914
Setting the mode of operation of the program.
Packit 6f3914
Packit 6f3914
``apply_updates``
Packit 6f3914
    boolean, default: False
Packit 6f3914
Packit 6f3914
    Whether packages comprising the available updates should be applied by ``dnf-automatic.timer``, i.e. installed via RPM. Implies ``download_updates``. Note that if this is set to ``False``, downloaded packages will be left in the cache till the next successful DNF transaction. Note that the other timer units override this setting.
Packit 6f3914
Packit 6f3914
``download_updates``
Packit 6f3914
    boolean, default: False
Packit 6f3914
Packit 6f3914
    Whether packages comprising the available updates should be downloaded by ``dnf-automatic.timer``. Note that the other timer units override this setting.
Packit 6f3914
Packit 6f3914
.. _upgrade_type_automatic-label:
Packit 6f3914
Packit 6f3914
``upgrade_type``
Packit 6f3914
    either one of ``default``, ``security``, default: ``default``
Packit 6f3914
Packit 6f3914
    What kind of upgrades to look at. ``default`` signals looking for all available updates, ``security`` only those with an issued security advisory.
Packit 6f3914
Packit 6f3914
``random_sleep``
Packit 6f3914
    time in seconds, default: 0
Packit 6f3914
Packit 6f3914
    Maximal random delay before downloading.  Note that, by default, the ``systemd`` timers also apply a random delay of up to 5 minutes.
Packit 6f3914
Packit 6f3914
----------------------
Packit 6f3914
``[emitters]`` section
Packit 6f3914
----------------------
Packit 6f3914
Packit 6f3914
Choosing how the results should be reported.
Packit 6f3914
Packit 6f3914
.. _emit_via_automatic-label:
Packit 6f3914
Packit 6f3914
``emit_via``
Packit 6f3914
    list, default: ``email, stdio, motd``
Packit 6f3914
Packit 6f3914
    List of emitters to report the results through. Available emitters are ``stdio`` to print the result to standard output, ``command`` to send the result to a custom command, ``command_email`` to send an email using a command, and ``email`` to send the report via email and ``motd`` sends the result to */etc/motd* file.
Packit 6f3914
Packit 6f3914
``system_name``
Packit 6f3914
    string, default: hostname of the given system
Packit 6f3914
Packit 6f3914
    How the system is called in the reports.
Packit 6f3914
Packit 6f3914
---------------------
Packit 6f3914
``[command]`` section
Packit 6f3914
---------------------
Packit 6f3914
Packit 6f3914
The command emitter configuration. Variables usable in format string arguments are ``body`` with the message body.
Packit 6f3914
Packit 6f3914
``command_format``
Packit 6f3914
    format string, default: ``cat``
Packit 6f3914
Packit 6f3914
    The shell command to execute.
Packit 6f3914
Packit 6f3914
``stdin_format``
Packit 6f3914
    format string, default: ``{body}``
Packit 6f3914
Packit 6f3914
    The data to pass to the command on stdin.
Packit 6f3914
Packit 6f3914
---------------------------
Packit 6f3914
``[command_email]`` section
Packit 6f3914
---------------------------
Packit 6f3914
Packit 6f3914
The command email emitter configuration. Variables usable in format string arguments are ``body`` with message body, ``subject`` with email subject, ``email_from`` with the "From:" address and ``email_to`` with a space-separated list of recipients.
Packit 6f3914
Packit 6f3914
``command_format``
Packit 6f3914
    format string, default: ``mail -s {subject} -r {email_from} {email_to}``
Packit 6f3914
Packit 6f3914
    The shell command to execute.
Packit 6f3914
Packit 6f3914
``stdin_format``
Packit 6f3914
    format string, default: ``{body}``
Packit 6f3914
Packit 6f3914
    The data to pass to the command on stdin.
Packit 6f3914
Packit 6f3914
``email_from``
Packit 6f3914
    string, default: ``root``
Packit 6f3914
Packit 6f3914
    Message's "From:" address.
Packit 6f3914
Packit 6f3914
``email_to``
Packit 6f3914
    list, default: ``root``
Packit 6f3914
Packit 6f3914
    List of recipients of the message.
Packit 6f3914
Packit 6f3914
-------------------
Packit 6f3914
``[email]`` section
Packit 6f3914
-------------------
Packit 6f3914
Packit 6f3914
The email emitter configuration.
Packit 6f3914
Packit 6f3914
``email_from``
Packit 6f3914
    string, default: ``root``
Packit 6f3914
Packit 6f3914
    Message's "From:" address.
Packit 6f3914
Packit 6f3914
``email_to``
Packit 6f3914
    list, default: ``root``
Packit 6f3914
Packit 6f3914
    List of recipients of the message.
Packit 6f3914
Packit 6f3914
``email_host``
Packit 6f3914
    string, default: ``localhost``
Packit 6f3914
Packit 6f3914
    Hostname of the SMTP server used to send the message.
Packit 6f3914
Packit 6f3914
------------------
Packit 6f3914
``[base]`` section
Packit 6f3914
------------------
Packit 6f3914
Packit 6f3914
Can be used to override settings from DNF's main configuration file. See :doc:`conf_ref`.
Packit 6f3914