Skip to content
Snippets Groups Projects
Commit b326a67f authored by ale's avatar ale
Browse files

add license and a man page

parent 4c494db6
No related branches found
No related tags found
No related merge requests found
COPYING 0 → 100644
Copyright (c) 2014, <ale@incal.net>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
.TH CHANGED 1
.SH NAME
changed \- detects whether a file or directory have changed since the
last invocation
.SH SYNOPSIS
.BI "changed [--exclude=" pattern "] [--include=" pattern "] [--db=" path "] [--checksum] " "path ..."
.SH DESCRIPTION
.B changed
detects whether a file or directory tree have changed since the last
time the tool was invoked with those same arguments. It is primarily
meant to support configuration management logic, to restart services
when their configuration has changed.
Arguments can be files or directories: in the latter case,
.B changed
will recursively scan the filesystem. You can control the recursion by
utilizing the
.I --exclude
and
.I --include
options.
The tool stores its state in the directory specified by the
.I --db
option. It will compare the current state of the filesystem with how
it was the last time
.B changed
was invoked with the
.I exact
same arguments.
.B changed
will always report that there have been changes whenever the request
specification changes subtly, such as if you invoke it with the same
paths but different
.I --exclude
options.
.SH OPTIONS
.TP
.B \-\-checksum
Use a hash of the file contents for comparisons, rather than relying
on filesystem attributes (size, modification time). This makes the
tool noticeably slower, as it has to read all the files, but it is
appropriate for configurations that are regenerated constantly.
.TP
.BI \-\-exclude= pattern
Exclude files matching
.I pattern
from the recursive filesystem scan. This option can be specified
multiple times. By default,
.B changed
excludes backup files and Debian configuration artifacts, but the
default exclude list can be reset by specifying an empty
.I pattern
to this option.
.TP
.BI \-\-include= pattern
Only include files matching
.I pattern
in the recursive filesystem scan. This option can be specified
multiple times. If this option is present, it takes precedence over
patterns specified with the
.I --exclude
option.
.TP
.BI \-\-db= path
Store checksums in the directory specified by
.I path
(by default this is /var/lib/changed if the current user has uid 0,
$HOME/.changed otherwise).
.SH "EXIT STATUS"
.B changed
will exit with status 0 if the specified files have changed (or if no
previous state was found), or 1 if they have not. This makes it
possible to use it with relatively intuitive semantics:
.PP
.nf
.RS
if changed /etc/foo; then restart-foo; fi
.RE
.fi
.PP
.SH AUTHOR
Ale <ale at incal dot net>
.SH BUGS
Plenty, but still unknown.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment