Tarsnap - Online backups for the truly paranoid

Navigation menu

Running Tarsnap on multiple machines with the same key

Some users find it desirable to run Tarsnap on multiple systems with the same key id, as it may:

  • Improve the effectiveness of the deduplication.
  • Enable using systems with different levels of security / trust.

This is entirely possible, provided that:

  • You only run Tarsnap on one machine at once.
  • The machine running Tarsnap has a cache directory with an accurate view of the server state.

There are three methods: sharing the cache directory, copying the latest cache directory, and using tarsnap --fsck. In all cases, you should copy the tarsnap key file (or a subset key with reduced permissions) from one machine to the other.

Shared cache directory

If you have a shared cache directory (e.g., via NFS or SMB), then that cache directory will naturally be up-to-date. We recommend that you use a lock file to ensure that only one machine tries to use this cache directory at once.

Copying the latest cache directory

Rather than having a network shared directory, you could copy the latest version of the cache directory from one system to all other systems.

Naturally, care must be taken so that you do not copy an old cachedir onto the newest version. If that occurs, you can get the latest cachedir by running tarsnap --fsck on one system, then copying the repaired directory to other systems.

Using tarsnap --fsck

Running tarsnap --fsck will reconstruct the cache directory in order to match the Tarsnap server state; you could therefore run this command immediately before performing a backup on each machine. However, --fsck needs to download all the metadata for each archive, which is ~0.1% of the total archive size. Depending on your internet connection (and CPU for processing the metadata), this could take a while.