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
commandSince 3.2.1.
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.
Options:
--time:
Specify run time,
Example: --time 2:00 --time 3:30 ...
--help:
Display help text and exit.
--time
Specify the start time of the run
You can specify multiple times
Redirect the output to generate a configuration file.
Note:
The service file must be created in advance with pgroonga-generate-primary-maintainer-service.sh
command.
NAME
part of NAME.service
and NAME.timer
must be equalThe command path depends on the environment
Here is an example of executing at 1:15 and 23:45.
$ 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
$ sudo -H systemctl enable --now pgroonga-primary-maintainer.timer
$ 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.
$ sudo -H systemctl disable --now pgroonga-primary-maintainer.timer