quickstart.rst 1.13 KB
Newer Older
Mattias Lindvall's avatar
Mattias Lindvall committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
.. SPDX-License-Identifier: BSD-2-Clause

Quickstart
==========

Step 1: Create config file
--------------------------

The default location is
``/usr/local/etc/zsm.yaml`` on FreeBSD and ``/etc/zsm.yaml`` on Linux.

.. code-block:: yaml

    snapshots:
      - dataset: "tank/data"
16
        label: "daily"
17
        frequency: "1d"
18
        retention: 30
Mattias Lindvall's avatar
Mattias Lindvall committed
19 20

      - dataset: "tank/data"
21
        label: "hourly"
22
        frequency: "1h"
23
        retention: 24
Mattias Lindvall's avatar
Mattias Lindvall committed
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51

Step 2: Verify configuration
----------------------------

Not required, but a good sanity check.

Validate the config file
^^^^^^^^^^^^^^^^^^^^^^^^

.. code-block:: text

    $ sudo zsm validate-config

Perform a dry run
^^^^^^^^^^^^^^^^^

.. code-block:: text

    $ sudo zsm cron --dry-run --log-console


Step 3: Add to crontab
----------------------

Add a line to crontab as the root user, passing the ``cron`` command to zsm.

.. code-block:: text

52
    */1 * * * * LANG=en_US.UTF-8 zsm cron
Mattias Lindvall's avatar
Mattias Lindvall committed
53 54 55 56 57 58 59

The log file is by default located at ``/var/log/zsm.log``,
and the default log level is ``INFO``.

If you need help creating a crontab line, check out `crontab guru`_.

.. _crontab guru: https://crontab.guru/