This is a document for PGroonga 2.X and 3.X. See PGroonga 1.x document when you're using old PGroonga.

pgroonga-generate-primary-maintainer-timer.sh command

Since 3.2.1.

Summary

This command outputs the contents of the .timer file for periodic execution of pgroonga-primary-maintainer.sh command using systemd/Timers.

It is used in conjunction with the service file generated by pgroonga-generate-primary-maintainer-service.sh command.

Usage

Options:
--time:
  Specify run time,
  Example: --time 2:00 --time 3:30 ...
--help:
  Display help text and exit.

Example

Redirect the output to generate a configuration file.

Note:

Options

Here is an example of executing at 1:15 and 23:45.

Generate

$ sudo -u postgres -H /usr/pgsql-12/bin/pgroonga-generate-primary-maintainer-timer.sh \
  --time 1:15 \
  --time 23:45 | \
  sudo -H tee /lib/systemd/system/pgroonga-primary-maintainer.timer
# How to install:
#   /usr/pgsql-12/bin/pgroonga-generate-primary-maintainer-timer.sh | sudo -H tee /lib/systemd/system/pgroonga-primary-maintainer.timer
#   sudo -H systemctl daemon-reload
#
# Usage:
#
#   Enable:  sudo -H systemctl enable --now pgroonga-primary-maintainer.timer
#   Disable: sudo -H systemctl disable --now pgroonga-primary-maintainer.timer
[Unit]
Description=PGroonga primary maintainer
[Timer]
OnCalendar=*-*-* 1:15:00
OnCalendar=*-*-* 23:45:00
[Install]
WantedBy=timers.target

Enable systemd timer

$ sudo -H systemctl enable --now pgroonga-primary-maintainer.timer

Status check

$ sudo -H systemctl status pgroonga-primary-maintainer.timer
● pgroonga-primary-maintainer.timer - PGroonga primary maintainer
   Loaded: loaded (/usr/lib/systemd/system/pgroonga-primary-maintainer.timer; enabled; vendor preset: disabled)
   Active: active (waiting) since Fri 2024-06-28 08:28:58 UTC; 14min ago
  Trigger: Fri 2024-06-28 23:45:00 UTC; 15h left

Jun 28 08:28:58 temp systemd[1]: Started PGroonga primary maintainer.

Disable systemd timer

$ sudo -H systemctl disable --now pgroonga-primary-maintainer.timer

See also