1 .\" Copyright (C) 2002 Ben Kibbey <bjk@arbornet.org>
3 .\" This program is free software; you can redistribute it and/or modify
4 .\" it under the terms of the GNU General Public License as published by
5 .\" the Free Software Foundation; either version 2 of the License, or
6 .\" (at your option) any later version.
8 .\" This program is distributed in the hope that it will be useful,
9 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
10 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 .\" GNU General Public License for more details.
13 .\" You should have received a copy of the GNU General Public License
14 .\" along with this program; if not, write to the Free Software
15 .\" Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 .Nd watch files for changes
35 .Op Fl r Ar count | Fl t Ar count
47 is a daemon which watches a files access, modification and inode change times
50 and can also check MD5 checksums if
52 is available at compile-time. Filenames obtained from a file list via the
54 option or from the command line are relative to the current directory unless
58 If a file specified on the command line or in a file list is a directory and
61 then the directory will be recursed having all files and subdirectories added
62 to the list of files to watch. Note that this will modify the access time of
63 the directories when loading or reloading a file list or on startup.
66 The following command line options are available:
70 Obtain a list of files to watch, one per line, from
73 The priority or niceness level,
77 of the daemon process and executed commands. Only the superuser can set a
78 priority lower than the parent process.
80 Interval in seconds to wait between file checks. Must be greater than zero.
84 Check the acces time of the file.
86 Check the modification time of the file.
88 Check the inode change time of the file.
90 Check the MD5 checksum of the file. The files checksum is updated after
91 detecting a change. The files modification time is used as the time
92 difference. Note that both MD5 and access time checking
94 cannot be specified because MD5 checking modifies the access time. Also note
95 that this option increases CPU overhead significantly, escpecially with a
96 short time interval and lots of files. This option is only available if
101 Check for errors when accessing the file via
106 Check everything except MD5 checksums. This option is a shortcut for
110 Execute a command via
112 after detecting a file change. Any arguments to
114 which contain spaces must be enclosed in double quotes
117 argument list sane. To include a double quote or backslash character in an
118 argument itself, precede it with a backslash
122 below for special character expansions.
124 Maximum number of times to run
126 for each file. A setting of
130 an infinite number of times. The default is
133 Total number of times to run
136 This option overrides
139 Log changes to the specified
142 .Pa ~/bubblegum.log .
151 will disable file logging.
153 will log only the first change of each file.
155 will log all changes of all files up to an error if error checking is enabled.
156 If the error changes, then the error is logged. If the error disappears, then
157 logging for that file continues as normal. The default is
162 and disable file logging. Note that the logging level still applies.
164 If a file is a symbolic link, check the link itself, not the file the link
167 An alternate process id file to use. The default is
168 .Pa ~/bubblegum.pid .
175 Terminate an already running daemon.
179 Version and copyright information.
183 When specifying a command with the
185 command line option, special character expansions are available to show
186 information about a files change. The following expansions are available and
187 each should be enclosed in double quotes
189 to keep the argument list sane
194 .Bl -tag -compact -width \&%\&%
196 Full path of the filename.
208 File permission mode in octal.
210 Time stamp of the latest change.
212 Time of the last change.
214 Time stamp of when the change was detected.
216 Time difference of the latest and last change in
217 .Em type:days:hours:minutes:seconds
225 for access, modification or inode change time respectively.
231 A comma separated list of changes:
239 A comma separated list change types, if available. The recognized
249 If no change type is available then a single
253 for definitions of the change types.
255 If an error occurs while accessing the file with
259 and error checking has been enabled with the
261 command line option, then this is expanded to the error string via
263 Otherwise it holds a single
269 has been run for the current file and the total number of times
270 allowed specified with the
274 command line options.
282 .Bl -tag -compact -width SIGTERM
284 Force the current timer to expire causing the next file check.
286 Reload the file list specified with the
288 command line option keeping the original changed bits and command runs for
291 Reset only the changed bits for all files.
293 Reset changed bits and command runs for all files.
295 Terminate the daemon.
299 .Bl -tag -width BUBBLEGUM_LOG -compact
301 Logging file. Command line option
303 will override this variable.
305 Process id file. Command line option
307 will override this variable.
311 .Bl -tag -compact -width ~/bubblegum.log
312 .It Pa ~/bubblegum.log
313 Default logging file.
314 .It Pa ~/bubblegum.pid
315 Default process id file.
319 .Dl \&% bubblegum \&-e \&'script.sh \&"\&%f\&" \&"\&%c\%" \&"\&%y\&"\&' \&-As \&-f filelist
332 .An "Ben Kibbey" Aq bjk@arbornet.org