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 \
$ACD_LOCAL/cloud.plaintext
# 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_LOCAL/local.plaintext
acd_cli mount --modules="subdir,subdir=/Encrypted" \
$ACD_LOCAL/cloud.encrypted
# Backup key & configuration for safe-keeping
# TODO: this shouldn't be in ~/.cache/!
ln \
$ACD_LOCAL/local.encrypted/.encfs6.xml \
$ACD_LOCAL/encfs6.xml
encfs \
$ACD_LOCAL/cloud.encrypted \
$ACD_LOCAL/cloud.plaintext
unionfs-fuse -o cow \
$ACD_LOCAL/local.plaintext=RW:\
$ACD_LOCAL/cloud.plaintext=RO \
$HOME/Cloud
# 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/* \
/Encrypted/
# 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
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.
https://amc.ovh/