Seed the index
Use this when a destination already holds a copy of the data that irsync
did not make: an earlier rsync, a restore from backup, a disk you copied by
hand. Seeding hashes those files into the destination’s index first, so that
the first session reuses their content for renamed and copied files instead
of fetching it over the network.
irsync keeps one index per root under state_dir (see
Configuration). The index
only knows files that irsync has hashed: files it placed, files it updated,
and files read by a -c run. Without seeding, a session still finds some
reuse on its own: before it fetches a whole file of 64 KiB or more, it hashes
up to four destination files of exactly that size that the index does not
know yet. Seeding covers the rest.
Seeding never makes a wrong decision. Content taken from a local file is verified like any other, and an index row that has gone stale falls back to a fetch.
On the client, before a pull
Index the directory that the pull writes into. For
irsync -a myserver:photos/ ~/Photos/ that is ~/Photos; for
irsync -a myserver:photos ~/ it is ~/photos.
-
See how much would be read:
irsync index -n ~/PhotosIt prints one line per root:
ROOT: N file(s), M to hash (B bytes). -
Hash the files:
irsync index ~/PhotosFiles whose index row is still fresh (same size, modification time, change time, device and inode) are skipped, so running it again costs only the walk.
You can name several roots in one command. If a file cannot be read or a
directory cannot be listed, irsync index reports it, carries on, and exits
with code 23.
On the daemon, before a push
Run these on the daemon’s machine, as the account the daemon runs as and with
the same --config, so that they write to the daemon’s state_dir.
-
Hash one export, or every export:
irsync index --export photos irsync index --export all--exportmay be given more than once, and beside local roots.-ncounts what would be hashed. The daemon uses the new rows from its next session on. -
Or let the daemon hash an export every time it starts, which suits an export whose files change outside
irsync:irsync config set exports.photos.index_at_start trueFor a new export,
irsync export add photos:/srv/photos --index-at-startdoes the same. The daemon hashes the export in the background when it starts, or at the first connection for an export added while it runs, and logsexport indexedwhen done. -
Or, from a client with
admin = "rw"on the server, ask its daemon to hash an export now, and wait until it is done:irsync remote myserver index photosIt counts the files it could not read; the server’s log names them. See Manage a server from your client.
See also
- Clean up state: how index entries of deleted files are removed.
- Command line: the flags of
irsync index.