Blame doc/automatic.rst

Packit Service 21c75c
..
Packit Service 21c75c
  Copyright (C) 2014-2018 Red Hat, Inc.
Packit Service 21c75c
Packit Service 21c75c
  This copyrighted material is made available to anyone wishing to use,
Packit Service 21c75c
  modify, copy, or redistribute it subject to the terms and conditions of
Packit Service 21c75c
  the GNU General Public License v.2, or (at your option) any later version.
Packit Service 21c75c
  This program is distributed in the hope that it will be useful, but WITHOUT
Packit Service 21c75c
  ANY WARRANTY expressed or implied, including the implied warranties of
Packit Service 21c75c
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General
Packit Service 21c75c
  Public License for more details.  You should have received a copy of the
Packit Service 21c75c
  GNU General Public License along with this program; if not, write to the
Packit Service 21c75c
  Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
Packit Service 21c75c
  02110-1301, USA.  Any Red Hat trademarks that are incorporated in the
Packit Service 21c75c
  source code or documentation are not subject to the GNU General Public
Packit Service 21c75c
  License and may only be used or replicated with the express permission of
Packit Service 21c75c
  Red Hat, Inc.
Packit Service 21c75c
Packit Service 21c75c
###############
Packit Service 21c75c
 DNF Automatic
Packit Service 21c75c
###############
Packit Service 21c75c
Packit Service 21c75c
==========
Packit Service 21c75c
 Synopsis
Packit Service 21c75c
==========
Packit Service 21c75c
Packit Service 21c75c
``dnf-automatic [<config file>]``
Packit Service 21c75c
Packit Service 21c75c
=============
Packit Service 21c75c
 Description
Packit Service 21c75c
=============
Packit Service 21c75c
Packit Service 21c75c
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 Service 21c75c
Packit Service 21c75c
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 Service 21c75c
Packit Service 21c75c
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 Service 21c75c
Packit Service 21c75c
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 Service 21c75c
Packit Service 21c75c
- dnf-automatic-notifyonly
Packit Service 21c75c
- dnf-automatic-download
Packit Service 21c75c
- dnf-automatic-install
Packit Service 21c75c
Packit Service 21c75c
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 Service 21c75c
Packit Service 21c75c
===================
Packit Service 21c75c
 Run dnf-automatic
Packit Service 21c75c
===================
Packit Service 21c75c
Packit Service 21c75c
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 Service 21c75c
Packit Service 21c75c
For example: ``systemctl enable --now dnf-automatic-notifyonly.timer``
Packit Service 21c75c
Packit Service 21c75c
===========================
Packit Service 21c75c
 Configuration File Format
Packit Service 21c75c
===========================
Packit Service 21c75c
Packit Service 21c75c
The configuration file is separated into topical sections.
Packit Service 21c75c
Packit Service 21c75c
----------------------
Packit Service 21c75c
``[commands]`` section
Packit Service 21c75c
----------------------
Packit Service 21c75c
Packit Service 21c75c
Setting the mode of operation of the program.
Packit Service 21c75c
Packit Service 21c75c
``apply_updates``
Packit Service 21c75c
    boolean, default: False
Packit Service 21c75c
Packit Service 21c75c
    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 Service 21c75c
Packit Service 21c75c
``download_updates``
Packit Service 21c75c
    boolean, default: False
Packit Service 21c75c
Packit Service 21c75c
    Whether packages comprising the available updates should be downloaded by ``dnf-automatic.timer``. Note that the other timer units override this setting.
Packit Service 21c75c
Packit Service 21c75c
``network_online_timeout``
Packit Service 21c75c
    time in seconds, default: 60
Packit Service 21c75c
Packit Service 21c75c
    Maximal time dnf-automatic will wait until the system is online. 0 means that network availability detection will be skipped.
Packit Service 21c75c
Packit Service 21c75c
``random_sleep``
Packit Service 21c75c
    time in seconds, default: 0
Packit Service 21c75c
Packit Service 21c75c
    Maximal random delay before downloading.  Note that, by default, the ``systemd`` timers also apply a random delay of up to 1 hour.
Packit Service 21c75c
Packit Service 21c75c
.. _upgrade_type_automatic-label:
Packit Service 21c75c
Packit Service 21c75c
``upgrade_type``
Packit Service 21c75c
    either one of ``default``, ``security``, default: ``default``
Packit Service 21c75c
Packit Service 21c75c
    What kind of upgrades to look at. ``default`` signals looking for all available updates, ``security`` only those with an issued security advisory.
Packit Service 21c75c
Packit Service 21c75c
----------------------
Packit Service 21c75c
``[emitters]`` section
Packit Service 21c75c
----------------------
Packit Service 21c75c
Packit Service 21c75c
Choosing how the results should be reported.
Packit Service 21c75c
Packit Service 21c75c
.. _emit_via_automatic-label:
Packit Service 21c75c
Packit Service 21c75c
``emit_via``
Packit Service 21c75c
    list, default: ``email, stdio, motd``
Packit Service 21c75c
Packit Service 21c75c
    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 Service 21c75c
Packit Service 21c75c
``system_name``
Packit Service 21c75c
    string, default: hostname of the given system
Packit Service 21c75c
Packit Service 21c75c
    How the system is called in the reports.
Packit Service 21c75c
Packit Service 21c75c
---------------------
Packit Service 21c75c
``[command]`` section
Packit Service 21c75c
---------------------
Packit Service 21c75c
Packit Service 21c75c
The command emitter configuration. Variables usable in format string arguments are ``body`` with the message body.
Packit Service 21c75c
Packit Service 21c75c
``command_format``
Packit Service 21c75c
    format string, default: ``cat``
Packit Service 21c75c
Packit Service 21c75c
    The shell command to execute.
Packit Service 21c75c
Packit Service 21c75c
``stdin_format``
Packit Service 21c75c
    format string, default: ``{body}``
Packit Service 21c75c
Packit Service 21c75c
    The data to pass to the command on stdin.
Packit Service 21c75c
Packit Service 21c75c
---------------------------
Packit Service 21c75c
``[command_email]`` section
Packit Service 21c75c
---------------------------
Packit Service 21c75c
Packit Service 21c75c
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 Service 21c75c
Packit Service 21c75c
``command_format``
Packit Service 21c75c
    format string, default: ``mail -Ssendwait -s {subject} -r {email_from} {email_to}``
Packit Service 21c75c
Packit Service 21c75c
    The shell command to execute.
Packit Service 21c75c
Packit Service 21c75c
``email_from``
Packit Service 21c75c
    string, default: ``root``
Packit Service 21c75c
Packit Service 21c75c
    Message's "From:" address.
Packit Service 21c75c
Packit Service 21c75c
``email_to``
Packit Service 21c75c
    list, default: ``root``
Packit Service 21c75c
Packit Service 21c75c
    List of recipients of the message.
Packit Service 21c75c
Packit Service 21c75c
``stdin_format``
Packit Service 21c75c
    format string, default: ``{body}``
Packit Service 21c75c
Packit Service 21c75c
    The data to pass to the command on stdin.
Packit Service 21c75c
Packit Service 21c75c
-------------------
Packit Service 21c75c
``[email]`` section
Packit Service 21c75c
-------------------
Packit Service 21c75c
Packit Service 21c75c
The email emitter configuration.
Packit Service 21c75c
Packit Service 21c75c
``email_from``
Packit Service 21c75c
    string, default: ``root``
Packit Service 21c75c
Packit Service 21c75c
    Message's "From:" address.
Packit Service 21c75c
Packit Service 21c75c
``email_host``
Packit Service 21c75c
    string, default: ``localhost``
Packit Service 21c75c
Packit Service 21c75c
    Hostname of the SMTP server used to send the message.
Packit Service 21c75c
Packit Service 21c75c
``email_to``
Packit Service 21c75c
    list, default: ``root``
Packit Service 21c75c
Packit Service 21c75c
    List of recipients of the message.
Packit Service 21c75c
Packit Service 21c75c
------------------
Packit Service 21c75c
``[base]`` section
Packit Service 21c75c
------------------
Packit Service 21c75c
Packit Service 21c75c
Can be used to override settings from DNF's main configuration file. See :doc:`conf_ref`.