Synchronize files through the sneakernet, i.e. using a removable drive.
Requirements:
- rsync. The version must support extended attributes (
-Xflag). - A removable drive with a filesystem matching the source and target computers.
- Feet or a compatible mean of transportation of the removable drive between computers.
Simply run pip install sneakersync.
The configuration is a YAML-formatted file that contains modules (directories to be synchronized) and filters (rules that exclude or include files or directories). Each module must contain a root entry (the top-level path to be synchronized) and may contain filters; if no filter is specified, all files and directories below the root of the module are included. Filters are defined by a list of include or exclude directives.
A minimal example which synchronizes the home folder of a user would look like:
modules:
- root: /home/john.doeTo exclude a directory (and its content) and files with a given extension from a module, add a filters directive:
modules:
- root: /home/john.doe
filters:
- exclude: /home/john.doe/.firefox/caches
- exclude: *.pycTo filter entries from all modules, use the top-level filters directive:
modules:
- root: /home/john.doe
- root: /home/jane.blogs
filters:
- exclude: .firefox/cachesFilters defined at the top-level will have priority over module-level filters.
Each module can have a host-specific root, e.g. if your username differs between computers, with the following syntax:
modules:
- root:
first.host: /home/john.doe
second.host: /home/johnIf host-specific roots are used, sending or receiving using an undeclared host will cause an error.
- Create a filesystem on a removable drive that matches the source and target computers.
- Optional, but highly recommended: encrypt your removable drive.
- Store the configuration in a file named
sneakersync.cfgon the root of the drive. - To send data, run
sneakersync send <PATH_TO_YOUR_DRIVE>. - Move your drive to the other computer and plug it in.
- To receive data, run
sneakersync receive <PATH_TO_YOUR_DRIVE>.
Known limitations:
- The last access time (
atime) is not preserved: rsync needs to access files in order to transfer them. - The creation / meta-data change time (
ctime) is not preserved: this attribute is not user-modifiable.