summain man page

summain — gather file checksums and metadata

Synopsis

summain [-cCHECKSUM] [--checksum=CHECKSUM] [--config=FILE] [--dump-config] [--dump-setting-names] [--generate-manpage=TEMPLATE] [-h] [--help] [--help-all] [--list-config-files] [--version] [--no-default-configs] [--dump-memory-profile=METHOD] [--exclude=FIELD] [--log=FILE] [--log-keep=N] [--log-level=LEVEL] [--log-max=SIZE] [--log-mode=MODE] [-m] [--mangle-paths] [--no-mangle-paths] [--memory-dump-interval=SECONDS] [--output=FILE] [-fOUTPUT-FORMAT] [--output-format=OUTPUT-FORMAT] [-r] [--relative-paths] [--no-relative-paths] [--secret=SECRET] [FILE]...

Description

summain gathers metadata about files, and computes their checksums. It is intended to create a manifest of the files. The manifest can be used to see if something has changed: a new manifest can be created and compared with the old one with diff(1).

The manifest looks like this:

Name: foo/bar/foobar
SHA1: 1234123413241324
Mtime: 2010-01-01 02:08:00.127651 +0000
Mode: 1755

The filename is URL-encoded to ensure it is purely ASCII. Mode is in octal.

Only some inode fields are included. It does not make sense to compare, for example, the access time, so that is not included.

Time stamps are given using microsecond precision, for the benefit of those filesystems that can support precise timestamps. (Should be nanosecond, but Python return timestamps as floating point, and nanosecond precision is too much for the floating point type.)

The inode and device number fields will not be reported accurately. Instead, they are normalized so that manifests are useful after the files have been restored from backups. Accurate numbers would mean everything seems to have changed. Normalized means that there will be no differences. The numbers are reported so that hard links can be checked.

Directories named on the command line will be recursed automatically.

Options

-c, --checksum=CHECKSUM

which checksums to compute: MD5, SHA1, SHA224, SHA256, SHA384, SHA512; use once per checksum type (default is SHA1)

--exclude=FIELD

do not output or compute FIELD

--generate-manpage=TEMPLATE

fill in manual page TEMPLATE

-h, --help

show this help message and exit

-m, --mangle-paths

mangle (obfuscate) paths

--no-mangle-paths

opposite of --mangle-paths

--output=FILE

write output to FILE, instead of standard output

-f, --output-format=OUTPUT-FORMAT

choose output format (rfc822, csv, json)

-r, --relative-paths

print paths relative to arguments

--no-relative-paths

opposite of --relative-paths

--secret=SECRET

use SECRET to make mangled paths unguessable

--version

show program's version number and exit

Configuration files and settings

--config=FILE

add FILE to config files

--dump-config

write out the entire current configuration

--dump-setting-names

write out all names of settings and quit

--help-all

show all options

--list-config-files

list all possible config files

--no-default-configs

clear list of configuration files to read

Logging

--log=FILE

write log entries to FILE (default is to not write log files at all); use "syslog" to log to system log, "stderr" to log to the standard error output, or "none" to disable logging

--log-keep=N

keep last N logs (10)

--log-level=LEVEL

log at LEVEL, one of debug, info, warning, error, critical, fatal (default: debug)

--log-max=SIZE

rotate logs larger than SIZE, zero for never (default: 0)

--log-mode=MODE

set permissions of new log files to MODE (octal; default 0600)

Peformance

--dump-memory-profile=METHOD

make memory profiling dumps using METHOD, which is one of: none, simple, or meliae (default: simple)

--memory-dump-interval=SECONDS

make memory profiling dumps at least SECONDS apart

Example

To make a complete manifest of a directory tree so that you can later verify that nothing at all has changed:

summain foo > foo.summain

To verify that nothing has changed:

summain foo > foo.summain-2
diff -u foo.summain foo.summain-2

Referenced By

seivots-summary(1).