You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Colin Okay 2d4a607a04 oops 6 months ago
.gitignore initial commit 7 months ago
LICENSE license 7 months ago updated readme, version bump 6 months ago
app.lisp oops 6 months ago
encryption.lisp reorganizing code 6 months ago
model.lisp added compression options 6 months ago
package.lisp added tote app system 7 months ago
tote.asd Added exclude pattern feature. Minor version bump 6 months ago
tote.lisp Added exclude pattern feature. Minor version bump 6 months ago
util.lisp reorganizing code 6 months ago


Encrypted file synchronization.

I made this because I wanted a nice way to keep some files in sync between different personal laptops that

  1. Wasn't sensitive to the filesystem formatting on various disks
  2. Gave me a choice about what to synchronize and how in case of synchronization conflict
  3. Created encrypted repositories, in case I lose my USB drive

Building & Installing

git clone 
cd tote
sbcl --load app.lisp
cp tote ~/.local/bin   # or someplace else in your path

Basic use

Here is a shell session that shows most of the features of tote

you@yoursystem:~$ tote
Usage: tote [-cvzh] [OPTIONS]

Encrypted file synchronization.
  --local=PATH                A directory that you want to synchronize.
  --repo=PATH                 A directory where your encrypted store is located
  -k, --key=STR               Password used to encrypt store.
                              Environment: TOTE_KEY
  -c, --confirm               Ask user to confirm the syncrhonization plan before executing.
  -v, --verbose               Prints out the synchroniztion plan.
  -z, --compress              On new repositories, whether or not to use compression. 
                              May speed up  transfer to slow storage media.
  -p, --policy=TYPE           The conflict resolution policy. One of 'ask', 'always-push', 
                              'always-push', or 'always-skip'
  -e, --error-policy=TYPE     The error recovery policy. Values are 'abort' or 'debug'.
  -h, --help                  Print this help and exit.

you@yoursystem:~$ export TOTE_KEY=yourpassword

you@yoursystem:~$ ls junk
a.txt  b.txt  c.txt  d.txt

# -v is verbose -c prompts the user to confirm the plan
you@yoursystem:~$ tote --local ~/junk --repo ~/junk-repo  -vc
CREATE               => d.txt
CREATE               => c.txt
CREATE               => b.txt
CREATE               => a.txt
Execute this plan? (y or n) y
Executing sync
CREATE         : d.txt
CREATE         : c.txt
CREATE         : b.txt
CREATE         : a.txt

# this is what the contents of the repo might like
# both the file names and their contents are encrypted
you@yoursystem:~$ ls ~/junk-repo
1c5ad43a32681b50  63258ac376f6f890  799d88af04fc9ff9  bb9311b6c5b36cdd  d04119618eb20215

# change one file, add a new one
you@yoursystem:~$ echo foo >> junk/foo.txt
you@yoursystem:~$ echo blah >> junk/a.txt 

# you don't have to 'confirm' the plan
you@yoursystem:~$ tote --local ~/junk --repo ~/junk-repo  -v
Executing sync
CREATE         : foo.txt
PUSH           : a.txt

# clone the repo to a new location
you@yoursystem:~$ tote --local ~/copy-of-junk --repo ~/junk-repo  -v
Executing sync
PULL           : foo.txt
PULL           : a.txt
PULL           : c.txt
PULL           : b.txt
PULL           : d.txt

# change a file in the copy
you@yoursystem:~$ echo blah >> copy-of-junk/foo.txt 

you@yoursystem:~$ tote --local ~/copy-of-junk --repo ~/junk-repo  -v
Executing sync
PUSH           : foo.txt

# and sync it to the orginal location
you@yoursystem:~$ tote --local ~/junk --repo ~/junk-repo  -v
Executing sync
PULL           : foo.txt

# change the same file in both places
you@yoursystem:~$ echo blahblah > junk/a.txt 
you@yoursystem:~$ echo nahnah > copy-of-junk/a.txt 

# sync one of them to the repo
you@yoursystem:~$ tote --local ~/junk --repo ~/junk-repo  -v
Executing sync
PUSH           : a.txt

# the default conflict resolution policy is to ask the user what to do
you@yoursystem:~$ tote --local ~/copy-of-junk --repo ~/junk-repo -v
Executing sync
CHOOSE         : a.txt

a.txt changed both locally and in backup.
Push local version to backup? (y or n) n

Pull from backup? (y or n) y

Notes And Advisory

File structure of the encrypted repository

Presently, tote creates one file in the encrypted repository for each file being synchronized. Additionally, it creates a number of directories. All of these files and directories have opaque names.

Using the compression option

Unless the files being toted around are fairly large (a pdf ebook collection for example), or unless you are synchronizing to a network drive, you are unlikely to see a speedup when using tote with compression. If, for example, you are synchronizing thousands of small text files to a slow USB drive then you're better off not using compression. Getting a file handler on a slow device seems to take more than writing small amounts of data to disk, and compression itself also takes time. Synchronizing those same text files to a network drive, however, might be faster using the compression, depending on network conditions.