Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

fileset reference

fileset records the state of a directory tree in a manifest and later verifies the tree against it. A manifest is a small database that holds each file’s checksum and metadata, so that a copy of the tree, or the same tree later, can be checked against it. It is a SQLite file by default. There are two other storage backends: fjall, which keeps the manifest in a directory, and redb, a single file made to be read from media that cannot be written to.

Introduction to fileset explains the idea and leads to the how-to guides: verifying an rsync, rclone or irsync transfer, checking data for bitrot, and keeping a manifest current.

Commands

fileset init   [OPTIONS] PATH
fileset update [OPTIONS] PATH
fileset check  [OPTIONS] PATH
fileset list   [-v] [--manifest MPATH] PATH [PATTERN]

PATH is the root of the tree and must be a directory.

init

init scans the tree and creates its manifest, at PATH/.fileset.sqlite by default. It refuses to run when:

  • a manifest already exists. The exception is a manifest left by an init that was interrupted (killed, or the machine went down): it holds nothing, so init replaces it with a warning.
  • the tree lies inside another fileset: a .fileset.sqlite, .fileset.fjall or .fileset.redb exists in a parent directory of PATH. This is checked before anything is written.
  • the tree holds a manifest in a subdirectory. This is found when the scan reaches it; init then removes the manifest it had begun.

Nested filesets are not supported. If the scan fails, init removes the manifest it began.

update

update scans the tree and brings an existing manifest up to date. It refuses to run if there is no manifest, or if the manifest was left by an interrupted init (run init again). A manifest in a subdirectory is a warning, not an error.

A regular file is hashed again only when its size, mtime or inode differ from the manifest (on Windows, the file index stands for the inode), or when the manifest holds no hash for it. Otherwise the stored hash is kept. A file that cannot be read produces the warning cannot hash <path> and is recorded without a hash. Rows that have not changed are not rewritten. Whatever the scan did not see is removed from the manifest: deleted entries, and also everything below a directory that could not be read or a mount point that was not crossed. Each such directory and mount point produces a warning.

init and update share one engine and differ only in these preconditions.

check

check scans the tree and reports every difference between it and the manifest. It never changes the tree or the manifest’s contents. Opening a fjall manifest does touch its journal and lock files; a redb manifest is only read.

check hashes a regular file only when the manifest has an entry for it and content is compared. A file the manifest holds no hash for (it could not be read when it was recorded) produces the warning no stored checksum for <path>. A manifest in a subdirectory produces the warning nested manifest at <path>.

list

list prints what the manifest holds: one line per entry, with its checksum and metadata (see Listing). fileset ls is the same command.

list reads only the manifest. It does not look at the tree, so it says what was recorded, not whether the tree still matches; that is check. It never changes the manifest’s contents or the tree. As with check, opening a fjall manifest does touch its journal and lock files; a SQLite or redb manifest is only read. With --manifest, PATH does not have to exist, so a copy of a manifest can be listed without its tree.

With a PATTERN, only the entries whose path matches it are listed. Quote the pattern, or the shell expands it first.

Options

All commands

OptionEffect
--manifest MPATHUse the manifest at MPATH instead of PATH/.fileset.sqlite, PATH/.fileset.fjall or PATH/.fileset.redb. It may lie outside the tree. A directory is read as fjall, a file that starts as a redb file does as redb, any other file as SQLite.
--fail-on-warningsExit 1 instead of 0 when the run produced warnings.
--cross-mount-pointsDescend into directories on other filesystems. It has no effect on Windows, where no reparse point is entered (see Windows).
--no-dir-sortDo not sort directory entries before iterating.
-j, --jobs NThreads that hash file contents. Default: the number of CPUs. N is at least 1.
--walk-threads NThreads that list directories and read metadata. Default: 4. N is at least 1.
--no-builtin-excludesWalk the built-in excludes like any other directory.
-q, --quietSuppress progress.
-v, --verbosePrint one line per entry on stdout as it is handled (see Every entry, with -v), and turn progress off. Conflicts with --quiet.

More walk threads are often slower. On a 16-core machine with an APFS SSD, a no-change update of a 1.7 million entry tree took 24 s with 4 threads and 30 s with 8: the kernel serialises much of the metadata work.

Without --manifest, fileset looks for .fileset.sqlite, .fileset.fjall and .fileset.redb at the root. If more than one exists, it stops and asks for --manifest.

A manifest found at the root must be a real file or directory. fileset refuses one that is a symbolic link, because a tree from someone else could point it at a manifest of yours. To keep a manifest elsewhere, name it with --manifest; that path may be a link.

A manifest that came with a tree is not trusted. fileset refuses a .fileset.sqlite that holds anything but plain tables and indexes, and a .fileset.fjall directory with anything inside but files and directories. In a .fileset.redb every entry carries a checksum, and one that does not match is an error, not an entry.

The options above are for the commands that walk a tree. Of them, list takes only --manifest.

init only

OptionEffect
--store sqlite|fjall|redbBackend to create. Default: sqlite.
--no-compactionLeave a redb manifest as large as the run made it; see The redb backend. The other backends ignore it.

update only

OptionEffect
--rehashHash every regular file again, even if size, mtime and inode are unchanged.
--no-compactionLeave a redb manifest as large as the run made it; see The redb backend. The other backends ignore it.
--force-xattr-readsRead every entry’s extended attributes. By default an entry whose type, inode, size, mtime and ctime match the manifest keeps the attributes recorded there (changing an attribute updates the ctime); only an entry whose attributes could not be read in full is read again.

check only

OptionEffect
--relaxedCompare the relaxed tier; see Comparison tiers. Conflicts with --paranoid.
--paranoidCompare the paranoid tier; see Comparison tiers. Conflicts with --relaxed.
--ignore FIELDDrop one field from the comparison. Repeatable.
--require FIELDAdd one field to the comparison. Repeatable.

list only

OptionEffect
-v, --verboseAlso print the owner, the link count, device numbers and extended attributes of each entry.

Comparison tiers

TierCompared
--relaxedtype, content (blake3), symlink target, device numbers (rdev)
defaultrelaxed, plus mode, mtime, size
--paranoiddefault, plus uid, gid, nlink, xattr

The type is always compared. --ignore and --require adjust whichever tier is in effect, so “default plus owner” is --require uid --require gid. Field names:

blake3 target rdev mode mtime size uid gid nlink xattr

An unknown field name is an error (exit 2).

Some fields apply only to some types:

  • blake3 applies to regular files, target to symlinks, rdev to character and block devices.
  • size and nlink are not compared for directories.
  • mtime is not compared for the root, nor for the directory that holds the manifest when the manifest lies inside the tree: writing the manifest changes both.
  • A manifest inside the tree is recorded, but only its type is compared.

Output

check writes one line per differing entry to stdout:

ADD docs/new.txt kind=file
DEL docs/old.txt
CHG docs/a.txt mode=0644→0600 size=12→13
  • ADD: on disk, not in the manifest. kind is one of dir, file, symlink, fifo, socket, chardev, blockdev, other.
  • DEL: in the manifest, not on disk. This includes everything recorded below a directory that is now a file or a symlink.
  • CHG: in both, with at least one compared field differing. Each field is shown as field=<stored>→<observed>. If the type differs, only kind= is shown.
  • CHG <path> kind=<stored kind>→unverified: recorded in the manifest, but check could not observe it. It lies below a directory that could not be read or a mount point that was not crossed, or it could not be stat’ed. Content that cannot be verified counts as a difference (exit 1), not just a warning.

Field values:

FieldShown as
blake364 hexadecimal digits; unreadable when the file could not be read
modefour octal digits, such as 0644 or 4755
mtimeUTC with nanoseconds, such as 2026-01-31T12:00:00.000000005Z
size, uid, gid, nlink, rdevdecimal
targetthe link target; - if none
xattrone xattr:<name>=<stored>→<observed> per attribute that differs; - where the attribute is absent; values longer than 64 bytes are cut and end in …

Paths, link targets and attribute names and values are escaped. Printable UTF-8 and the space pass through, \ becomes \\, control bytes, DEL and bytes that are not valid UTF-8 become \xNN, and C1 controls and the bidi formatting characters become \u{...}.

Every entry, with -v

With -v, every entry gets a line on stdout, in the order it is walked and as soon as it is handled. check adds two kinds of line to the ones above:

PrefixMeaningPrinted
EQLin both, every compared field matches-v only
CHGin both, something differsalways
ADDon disk, not in the manifestalways
DELin the manifest, not on diskalways
SKPskipped on purpose-v only
EQL 2026/01/IMG_0001.jpg kind=file size=48213 mtime=2026-01-15T12:00:00.000000000Z mode=0644 blake3=81c4b7f7e0549f1514e9cae97cf40cf133920418d3dc71bedbf60ec9bd6148cb
CHG 2026/01/IMG_0002.jpg mode=0644→0600
ADD new.jpg kind=file
SKP .Spotlight-V100 reason=builtin-exclude
DEL old.jpg

init and update print nothing on stdout without -v. With it, they use the same prefixes for what happened to the manifest:

PrefixMeaning
ADDnew entry recorded
CHGentry changed in a way check could report
EQLnothing check could report changed
DELentry dropped: the path is gone or is no longer walked
SKPskipped on purpose
  • EQL in check, and ADD, CHG and EQL in init and update, show the entry in full: <path> kind= size= mtime= mode=, then blake3= when the entry has a checksum. check shows what is on disk; init and update show the entry as now recorded.
  • blake3= is left off for anything that is not a regular file, for the manifest itself, for a file that could not be read, and in a check that does not compare content (--ignore blake3).
  • SKP <path> reason=builtin-exclude: one of the built-in excludes was skipped.
  • DEL lines come after the walk, in check and in update.
  • In update, CHG covers every field check --paranoid compares, and a checksum gained or lost. The root’s mtime and a manifest inside the tree change whenever the manifest is written; check does not report that, so both show as EQL.
  • In update, DEL is also printed for entries that are still on disk but no longer walked: those below a built-in exclude, and those below a directory that could not be read.

grep -v '^EQL' leaves what differs.

Listing

list writes one line per manifest entry to stdout, and nothing to stderr:

$ fileset list ~/Photos '2026/**'
2026/01 kind=dir size=4096 mtime=2026-01-31T12:00:00.000000005Z mode=0755
2026/01/IMG_0001.jpg kind=file size=48213 mtime=2026-01-15T12:00:00.000000000Z mode=0644 blake3=81c4b7f7e0549f1514e9cae97cf40cf133920418d3dc71bedbf60ec9bd6148cb
2026/latest kind=symlink size=15 mtime=2026-01-31T12:00:00.000000005Z mode=0777 target=01/IMG_0001.jpg

The line is the one check -v prints for an entry, without a prefix: <path> kind= size= mtime= mode=, then blake3= when the entry has a checksum. A symlink also shows target=. The root of the tree is listed as ..

With -v, each line continues with uid=, gid= and nlink=, then rdev= for a character or block device, then one xattr:<name>=<value> per extended attribute, in name order. A value longer than 64 bytes is cut and ends in ….

Entries come in the order the manifest stores them: by path, compared byte by byte. Uppercase sorts before lowercase and img10 before img9. A directory is followed by its contents, except that a neighbour whose name goes on with a character that sorts before / (a space, -, ., + or ,) comes in between:

2024
2024-old
2024.txt
2024/a.jpg

The pattern is matched against the whole path below the root:

In the patternMatches
*any run of characters except /
**any run of characters, / included
?one character except /
[abc], [a-z]one of these characters; [!a-z] or [^a-z]: any other, except /
\ and a characterthat character itself
anything elseitself

So '*.jpg' lists the top level only, '**/*.jpg' every level below it, '2026/**' everything under 2026, and 2026 that one entry: a pattern that matches a directory does not list what is inside it. Upper and lower case differ. Trailing slashes and a leading ./ are ignored, so 2026/ means 2026. No pattern is an error; one that matches nothing prints nothing. The wildcards are those of irsync’s --exclude patterns, but here a pattern always covers the whole path: there, *.jpg matches at every level and a leading / ties a pattern to the top.

When its reader stops early, as in fileset list ~/Photos | head, list ends without an error.

Warnings and summary

Warnings go to stderr, prefixed WARN . Progress goes to stderr only when stderr is a terminal and neither -q nor -v is given. A summary line goes to stderr at the end:

added=1 deleted=1 changed=1 unchanged=40 warnings=0 (check)
entries=43 hashed=3 reused=40 warnings=0            (init, update)

Built-in excludes

The system keeps some names at the top of a volume for itself, and ordinary users cannot read them. At the root of the tree, and at every mount point crossed with --cross-mount-points, entries with these names are neither recorded nor descended. Skipping one is not a warning, so it does not trip --fail-on-warnings. The same names deeper in the tree are ordinary entries.

On Unix the names are the ones macOS keeps at the top of every volume it touches: .DocumentRevisions-V100, .Spotlight-V100, .TemporaryItems, .Trashes and .fseventsd. They are skipped on every Unix system, macOS or not: on a disk read elsewhere they are readable but still junk. A name must match exactly, case included.

On Windows the names are System Volume Information, which cannot be read, and $RECYCLE.BIN, which holds the deleted files of every user. They match in upper, lower or mixed case, as NTFS names do. fileset enters no mounted volume on Windows, so they are skipped at the root of the tree only. The macOS names are ordinary entries there.

A manifest written with --no-builtin-excludes may hold them. check without that option does not report them, and the next update without it drops them.

Files

PathContents
PATH/.fileset.sqliteThe manifest, SQLite backend (default). Its -wal, -shm and -journal sidecars are skipped by the scan.
PATH/.fileset.fjallThe manifest, fjall backend: a directory.
PATH/.fileset.redbThe manifest, redb backend: one file, with none beside it.

An update that finishes leaves the SQLite manifest as a single file. If another process holds it open, the -wal sidecar stays, with a warning; the next update folds it in.

The redb backend

fileset init --store redb keeps the manifest in one file, .fileset.redb. It is for a manifest that travels with its tree, onto a disc, a snapshot or a write-protected drive:

  • It reads where nothing can be written. check and list open the file for reading only. They create nothing beside it and change nothing in it. The other backends write when they open a manifest, so theirs has to be copied off such media first.
  • It is as small as it gets. redb uses the space an update frees again, but never gives it back, so the file would only grow. init and update therefore compact the manifest before they finish. Afterwards it is within a hundredth of the size a new init of the same tree gives. A million entries take about 100 MB, and compacting them under a second.
  • It is on disk when the command returns. The last thing init and update do is flush the manifest and close it.

--no-compaction skips the compaction. The manifest is as good, but can be up to twice the size, because redb grows its file in large steps. The next init or update without the option compacts it.

If init or update is killed, the manifest is left in need of a repair, which only an open for writing can make. check and list then stop with exit code 2 and say so. Run fileset update where the manifest can be written, or fileset init again if it was an init that was killed. A killed update keeps what it had recorded up to about a second before.

A redb manifest that is damaged, by a failing medium or on purpose, gives an error. Every entry is stored with a checksum of its path and content, which is checked whenever the entry is read, and update verifies the whole file before it writes to it. The manifest also holds a checksum of all its entries together. check and list compare it once they have read them all, so an entry that damage removed is an error too. These checksums guard against damage, not against someone who rewrites the manifest and its checksums to match.

Exit codes

CodeMeaning
0Clean. For list: the entries were printed, also when none matched.
1check found differences; or, with --fail-on-warnings, the run produced warnings. The second is the only way init and update return 1.
2The run itself failed.

Exit code 2 covers, among others: a manifest that cannot be opened or read; a root that is not a directory; a manifest schema newer than this fileset; check on a manifest schema older than this fileset (update migrates it); more than one manifest at the root without --manifest; a manifest at the root that is a symbolic link; init on a tree that already has a manifest, lies inside a fileset or contains a nested one; update on a tree that has none; check, update or list on a manifest made on the other platform family, and check on a stored path that is not a valid name on this platform (see Windows).

Read-only media

check never changes the tree. But a manifest inside a read-only tree, such as a snapshot, may fail to open: fileset exits 2 with a message that suggests --manifest. Copy the manifest somewhere writable and point --manifest at the copy. Check data for bitrot shows how.

A manifest made with --store redb does not need this: it opens on read-only media as it is.

Windows

fileset runs on Windows, on x86_64 and ARM64, with the tree on NTFS. A manifest records which family of systems made it, Unix (Linux, macOS, FreeBSD) or Windows, and fileset uses a manifest only on the family that made it. irsync itself does not run on Windows yet.

What a Windows manifest records

FieldValue on Windows
kinddir, file or symlink; any other reparse point, a junction included, is other
sizethe size in bytes; 0 for a directory and for a symlink
mtimethe last write time, in steps of 100 ns
blake3, targetas on Unix
ino, dev, nlinkthe file index, the volume serial number and the link count
ctimethe NTFS change time
mode, uid, gid, rdev, extended attributeszero or empty, so never a difference

Those fields are zero or empty in a Windows manifest and on a Windows tree alike, so they never differ and a check never reports a difference in mode, uid, gid or rdev, whatever the tier. --paranoid still compares nlink.

No comparison tier uses ctime. update decides by size, mtime and file identity whether to hash a file again, on Windows as on Unix. The change time is not part of that, so a file rewritten with its old mtime put back is not hashed again.

Names and paths

  • A name is stored as WTF-8. A well-formed name is plain UTF-8, the same bytes as in a Unix manifest. A name NTFS allows but UTF-16 does not, one with an unpaired surrogate, is stored in the three-byte form UTF-8 would use for that surrogate, so nothing is lost. Output shows those bytes as \xNN, like any bytes that are not valid UTF-8.
  • Bytes that are not valid WTF-8 are an error, never repaired.
  • Stored paths use /, on Windows too. The PATTERN of list uses /, and \ in it escapes the next character, as in the table of wildcards.
  • A symlink’s target is stored as the system gives it, in WTF-8, with its own separators. It is content, not a path of the manifest.
  • Paths longer than 260 characters work, and so do names the shell refuses, such as a trailing dot or space or CON.
  • check stops with exit code 2, naming the path, when the manifest holds a path that is not a valid name on Windows: bytes that are not WTF-8, or a component that is not exactly one name, such as ., .., C:x, an empty one, one with a \, or one with a character NTFS does not allow in a name (< > : " | ? * or a control character; ab:c would name a stream of ab). It does not report the path as deleted.
  • NTFS names are case-insensitive. A manifest can still hold two names that differ only in case, when it was made in a case-sensitive directory; it cannot be checked reliably in an ordinary one. If one of the two is missing, check does not report it, because the other answers to its name. A rename that changes only the case shows as an added entry, and the old name is not reported. The same holds on a case-insensitive macOS volume.
  • At the root of the tree, System Volume Information and $RECYCLE.BIN are skipped, whatever their case (see Built-in excludes).

Reparse points

fileset never follows a reparse point of any kind. It does not walk through a symlink, a junction or a mounted volume, so --cross-mount-points changes nothing on Windows. A symlink is recorded as symlink with its target. A junction or a mount point is recorded as other and not entered.

A reparse point that holds a file’s data is recorded as other too, and not hashed: a cloud placeholder (OneDrive Files On-Demand), and a file of Data Deduplication on Windows Server, among others. A check compares little for such an entry and never its content. Neither kind has been tested, OneDrive included.

The rules for a manifest that came with a tree hold as well, with one change: where Unix refuses a symbolic link, Windows refuses any reparse point.

  • A manifest found at the root that is a symlink or a junction is refused, with a message that starts <path> is a symbolic link. Name a manifest elsewhere with --manifest.
  • A fjall manifest with a reparse point inside is refused.
  • Hashing opens a file without following a reparse point, and checks that it is not one. A link swapped in after the walk makes the hash fail; it is not the hash of another file.

A redb manifest in use

Windows makes the locks on a file mandatory. While a fileset holds a redb manifest for writing, no other program can read it either, and a check, list or update on it stops with <path> is open in another fileset (for check and list, <path> is open in another fileset that is writing it).

Manifests from the other platform family

A manifest has a platform key, unix or windows. init writes it and update keeps it, in all three backends. A manifest without the key is refused: manifest meta key 'platform' missing.

check, update and list refuse a manifest made on the other family, with exit code 2 and a message that starts this manifest was made on unix, and this is windows (or made on windows, and this is unix) and ends fileset cannot use a manifest across the two yet. A platform value other than unix or windows is refused too: manifest platform '<value>' is not known to this fileset.

What is not recorded

The read-only attribute and the security descriptor (the owner and the access control list) are not recorded, so a change to either is not reported. Nor are the other attributes (hidden, system, compressed and the rest), the creation time and alternate data streams. See What fileset cannot catch.

Not supported

ReFS, FAT and exFAT volumes, network shares, and the folders a virtual machine shares with its host are not supported.

Known limitations

  • Symlink permission bits differ between Linux (always 0777) and macOS (set from the umask, often 0755), so a tree carried between them shows mode= changes on symlinks. Use --ignore mode or --relaxed.
  • fjall preallocates a sparse 64 MiB journal in the manifest directory. Copy a fjall manifest with a sparse-aware tool, such as cp --sparse=always or rsync --sparse, to avoid writing 64 MiB of zeros.

Holes in sparse files, hard links, ACLs, mount points, timestamp precision and the other things a check cannot see are in What fileset cannot catch.