comparison docs/man/man5/local-bsdtools-periodic.rst @ 404:6c0c9159744d

Move the manual pages for the periodic scripts into man secition 5
author Franz Glasner <fzglas.hg@dom66.de>
date Sat, 25 Feb 2023 16:37:01 +0100
parents docs/man/man8/local-bsdtools-periodic.rst@39e6f675621d
children
comparison
equal deleted inserted replaced
403:39e6f675621d 404:6c0c9159744d
1 .. -*- coding: utf-8; indent-tabs-mode: nil; -*-
2
3
4 local-bsdtools-periodic
5 =======================
6
7 Synopsis
8 --------
9
10 **daily/720.local-triggered-action**
11
12 **daily/750.local-trim-zfs**
13
14 **daily/800.local-ipv6-refresh**
15
16
17 Description
18 -----------
19
20 The package contains a set of periodic scripts.
21
22 All scripts are disabled by default.
23
24 As all :manpage:`periodic(8)` scripts given scripts can be configured
25 in :manpage:`periodic.conf(5)`.
26
27
28 Daily Scripts
29 ~~~~~~~~~~~~~
30
31 **720.local-triggered-action**
32
33 Take actions triggered by the existence of given files.
34
35 **daily_local_triggered_action_enable** (bool)
36 Set it to ``YES`` to enable this script.
37
38 **daily_local_triggered_action_files** (str)
39 The readability of any of the given files triggers the action.
40
41 **daily_local_triggered_action_condition** (str)
42 A condition to check before executing the action.
43
44 May be a Shell expression.
45
46 The list of existing trigger files -- which is a subset of
47 `daily_local_triggered_action_files` -- is available in the Shell
48 variable `TRIGGER_FILES`.
49
50 **daily_local_triggered_action_action** (str)
51 The action to execute to.
52
53 May be a Shell expression.
54
55 The list of existing trigger files -- which is a subset of
56 `daily_local_triggered_action_files` -- is available in the Shell
57 variable `TRIGGER_FILES`.
58
59 **daily_local_triggered_action_files_remove** (bool)
60 By default all existing trigger files given in
61 `daily_local_triggered_action_files` are deleted when the action
62 has been executed successfully.
63
64 Set to ``NO`` to disable this behaviour.
65
66 **daily_local_triggered_action_profiles** (str)
67 If a non-empty value is given the script executes in profile-mode.
68
69 If profiles are defined this script is re-executed once for for
70 every profile with the profile as parameter.
71
72 No other global option as `daily_local_triggered_action_enable`
73 is used.
74
75 Instead profile level configurations which are named after the
76 profile are used. The configuration variables have the form
77 `daily_local_triggered_action_${profile}_{files,condition,action,files_remove}`.
78
79 For the sake of variable evaluation some special characters in a given
80 profile are mapped to the underscore ``_``.
81
82 **750.local-trim-zfs**
83
84 If enabled it automatically trims ZFS pools at regular invervals by
85 calling :command:`zpool trim`.
86
87 **daily_local_trim_zfs_enable** (bool)
88 Set to ``YES`` to enable this script.
89
90 **daily_local_trim_zfs_pool** (str)
91 The list of ZFS pool to trim to.
92
93 If empty then all known pool are trimmed.
94
95 **daliy_local_trim_zfs_default_threshold** (int)
96 The number of days between trims.
97
98 Default: 35
99
100 **800.local-ipv6-refresh**
101
102 On some networks there are issuses of loosing IPv6 connectivity
103 after some uptime with BSD kernels.
104
105 This scripts helps to keep connectivity. It updates the IPv6
106 neighbour cache to ensure proper IPv6 connectivity by calling
107 :command:`traceroute6` at regular intervals.
108
109 **daily_local_ipv6_refresh_enable** (bool)
110 Set to `YES` to enable this script.
111
112 **daily_local_ipv6_refresh_flags** (str)
113 A list of flags given to :manpage:`traceroute(8)`.
114
115 Default: -n -w2 -q2 -m1 -I
116
117 **daily_local_ipv6_refresh_target** (str)
118 The target of :manpage:`traceroute6(8)`.
119
120 If empty then `ipv6_defaultrouter` as given by :manpage:`sysrc(8)`
121 is used -- if available.
122
123
124 Examples
125 --------
126
127 Conditions and actions can be complex Shell expressions. They are evauluated
128 with `eval` in the Shell::
129
130 daily_local_triggered_action_condition="service nginx onestatus || service apache2 onestatus"
131
132 daily_local_triggered_action_action="{ service nginx onereload && service apache2 onereload ; } || true"
133
134 Profiles::
135
136 daily_local_triggered_action_enable=YES
137
138 daily_local_triggered_action_profiles="p1 p2-1"
139
140 # If the file exists this is executed daily because it is not removed
141 daily_local_triggered_action_p1_files="trigger-for-p1.txt"
142 daily_local_triggered_action_p1_condition="true"
143 daily_local_triggered_action_p1_action="cat \${TRIGGER_FILES} | mail -s ALERT root"
144 daily_local_triggered_action_p1_remove_files="NO"
145
146 daily_local_triggered_action_p2_1_files="trigger-for-p2.txt"
147 daily_local_triggered_action_p2_1_condition="true"
148 daily_local_triggered_action_p2_1_action="echo 'something happened' | mail -s ALERT root"
149
150 Note that the use of `TRIGGER_FILES` must be quoted in condition and
151 action definitions because they are executed indirectly in the context
152 of the Shell's `eval`.
153
154
155 See Also
156 --------
157
158 :manpage:`local-bsdtools(8)`, :manpage:`periodic(8)`,
159 :manpage:`periodic.conf(5)`, :manpage:`rc.conf(5)`, :manpage:`sysrc(8)`,
160 :manpage:`zpool-trim(8)`, :manpage:`traceroute(8)`
161
162
163 Bugs
164 ----
165
166 For a given profile "p1" there is no evaluation of something like
167 "daily_local_triggered_action_p1_enable".