Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
changed
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
ale
changed
Commits
b326a67f
Commit
b326a67f
authored
10 years ago
by
ale
Browse files
Options
Downloads
Patches
Plain Diff
add license and a man page
parent
4c494db6
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
COPYING
+20
-0
20 additions, 0 deletions
COPYING
changed.1
+86
-0
86 additions, 0 deletions
changed.1
with
106 additions
and
0 deletions
COPYING
0 → 100644
+
20
−
0
View file @
b326a67f
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.
This diff is collapsed.
Click to expand it.
changed.1
0 → 100644
+
86
−
0
View file @
b326a67f
.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.
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment