Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Setting up a encrypted drive on Amazon Cloud Drive w/ EncFS and acd_cli


export ACD_LOCAL=$HOME/.cache/Amazon-Cloud-Drive

# To use this file later
export ENCFS6_CONFIG=$ACD_LOCAL/encfs6.xml


mkdir -p \
$ACD_LOCAL/local.encrypted \
$ACD_LOCAL/local.plaintext \
$ACD_LOCAL/cloud.encrypted \

# On first run, you'll need to setup EncFS. Just use the defaults.
# Since we don't upload the key, it's OK to use an empty passphrase
# Useful options, case insentive file names, 4K blocks, path-independent filenames
encfs \
$ACD_LOCAL/local.encrypted \

acd_cli mount --modules="subdir,subdir=/Encrypted" \

# Backup key & configuration for safe-keeping
# TODO: this shouldn't be in ~/.cache/!
ln \
$ACD_LOCAL/local.encrypted/.encfs6.xml \

encfs \
$ACD_LOCAL/cloud.encrypted \

unionfs-fuse -o cow \
$ACD_LOCAL/cloud.plaintext=RO \


# Periodically run:
# (will prevent uploading of key and config to cloud)
acd_cli sync
acd_cli upload -x 4 --exclude-ending encfs6.xml \
$ACD_LOCAL/local.encrypted/* \

Garbage collection

# Remove files older than 7 days and empty directories
find $ACD_LOCAL/local.encrypted/ -type f -mtime +7 -print0 | xargs -0 -n256 rm
find $ACD_LOCAL/local.encrypted/ -type d -empty -delete
# Or immediately remove any local files
find $ACD_LOCAL/local.encrypted/ -type f -print0 | xargs -0 -n256 rm


# Unmount everything
fusermount -u $HOME/Cloud/
fusermount -u $ACD_LOCAL/cloud.plaintext
fusermount -u $ACD_LOCAL/cloud.encrypted
fusermount -u $ACD_LOCAL/local.plaintext

This comment has been minimized.

Copy link

@triwats triwats commented Dec 1, 2015

Fancy giving some citation to the AMC blog since this is pretty much completely the same steps? Seems only fair considering the hard work they have done to get their guide in order.


This comment has been minimized.

Copy link

@crack00r crack00r commented Aug 11, 2016

Is there anyway to encrypt files, that are in the cloud, and not uploaded everything again?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment