-
Notifications
You must be signed in to change notification settings - Fork 2
/
sync-periodically.service
43 lines (40 loc) · 1.72 KB
/
sync-periodically.service
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# file misc-basile/sync-periodically.service
# on https:///github.com/bstarynk/misc-basile.git
# for Linux Debian/Buster systemd, encoded in UTF-8
# see https://wiki.debian.org/systemd/Services
# it should be installed as /etc/systemd/system/sync-periodically.service
# and then run systemctl enable sync-periodically.service
#
# © Copyright 2020 Basile Starynkevitch <[email protected]>
# (near Paris, France)
#
# This sync-periodically.service script is free software; you can
# redistribute it and/or modify it under the terms of the GNU General
# Public License as published by the Free Software Foundation; either
# version 2, or (at your option) any later version.
#
# this sync-periodically.service script is distributed in the hope that
# it will be useful, but WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
# the GNU General Public License for more details.
#
# Also see the sync-periodically.c program in same repository.
[Unit]
Description=a service to sync(2) periodially our disks on Debian
Documentation=See https:///github.com/bstarynk/misc-basile.git files sync-periodically.{c,service}
After=network.target sshd.service
ConditionPathExists=!/etc/local/sync-periodically-dont-run
[Service]
ExecStartPre=/bin/bash -c "[ -x /usr/local/bin/sync-periodically ]"
ExecStart=/usr/local/bin/sync-periodically --daemon --pid-file=/var/run/sync-periodically.pid --sync-period=3 --log-period=300
ExecReload=/usr/bin/ldd /usr/local/bin/sync-periodically
RestartSec= 500ms
Restart=on-failure
RestartPreventExitStatus=254
Type=notify
KillMode=process
RuntimeDirectory=/var/run
RuntimeDirectoryMode=0755
[Install]
WantedBy=multi-user.target
Alias=sync-periodically.service