Encrypt existing unencrypted directory


is it possible with rclone to encrypt an existing unencrypted directory with my settings?

What is your rclone version (output from rclone version)
rclone version
rclone v1.56.0

Which cloud storage system are you using? (eg Google Drive)
The rclone config contents with secrets removed.

type = drive
client_id = xxx
client_secret = xxx
scope = drive
root_folder_id = xxx
token = xxx

type = cache
remote = gdrive:/gdrive
plex_password = xxx
chunk_size = 5M
info_age = 1d
chunk_total_size = 10G

type = crypt
remote = gcache:/crypt
filename_encryption = standard
directory_name_encryption = true
password = xxx
password2 = xxx

type = crypt
remote = gdrive:/gdrive/crypt
filename_encryption = standard
directory_name_encryption = true
password = xxx
password2 = xxx




  • should not be using cache remote, it has been deprecated, has known but that will never get fixed.
  • should update to latest stable v1.57.0

cannot do an in-place encryption.
you would need to crypt into a new directory

can you tell me how a new correct config looks like with encryption?
and with which command can I encrypt the directory into a new directory?


i will make a suggestion, but i need to be sure i understand your current setup.

both of these commands should give the same output,
--- rclone lsd gcrypt:
--- rclone lsd gcrypt_upload:

root@debian ~ # rclone lsd gcrypt:
2021/11/19 19:54:34 NOTICE: WARNING: Cache backend is deprecated and may be removed in future. Please use VFS instead.
-1 2020-05-11 18:39:33 -1 archive
root@debian ~ # rclone lsd gcrypt_upload:
-1 2020-05-11 18:39:33 -1 archive
root@debian ~ #

ok, good the same output.
this is my advice, but the onus is one you to validate!!!

  • use gcrypt_upload,
  • no need to use gcrypt and gcache

what is the directory with the files you want to crypt?

I've moved the directory to root, it's called "unencrypted_dir"

i put it in the same place as archive directory

if you tell me how the configuration is better, i will adjust it

not sure exactly what you mean.

need to know the exact

  • source dir; is it gdrive:unencrypted_dir?
    verify it with rclone lsd
  • dir where you want the crypted files to be at, need the full path

he does not show me the directory, although it is there. but with the google account i can see the directory

rclone lsd gcrypt_upload:
-1 2020-05-11 18:39:33 -1 archive

yes dir name is unencrypted_dir

would it be better to first set the config correctly?

  • Need to know the exact source dir so you can run rclone?
  • For now, the config file is ok.

it looks like this here on my-drives

ih8cjhftf26fc2m... is the encrypted directory of archive

the problem is that unencrypted_dir is inside /gdrive/crypt
cannot have non-crypted files inside a rclone crypt remote.
so move unencrypted_dir to the root of gdrive.

then post the output of rclone lsd gdrive: -vv

rclone lsd gdrive: -vv
2021/11/23 20:29:18 DEBUG : rclone: Version "v1.57.0" starting with parameters ["rclone" "lsd" "gdrive:" "-vv"]
2021/11/23 20:29:18 DEBUG : Creating backend with remote "gdrive:"
2021/11/23 20:29:18 DEBUG : Using config file from "/root/.config/rclone/rclone.conf"
-1 2020-05-11 18:39:31 -1 gdrive
-1 2021-11-23 20:29:15 -1 unencrypted_dir
2021/11/23 20:29:19 DEBUG : 4 go routines active

ok, now we know the the source dir is

you need to pick a the destination dir, where do you want the crypted files to go?
the exact full path

1 Like

it should then be in the /gdrive/crypt/archive/ directory. also /gdrive/crypt/ih8cjhftf26fc2m...

based on this

type = crypt
remote = gdrive:/gdrive/crypt

/gdrive/crypt/archive/ would be gcrypt_upload:archive, correct?

1 Like

yes, correct
root@debian / # rclone lsd gcrypt_upload:
-1 2020-05-31 17:02:45 -1 archive

good, so now we know the source and dest

one caveat is if the same folder name exists in the root of both
then rclone would merge that two folders.

so the command should be this? upon you to confirm!!!???
rclone copy gdrive:unencrypted_dir gcrypt_upload:archive -vv --dry-run

very good, i will test it, thank you very much.

One more question are the files downloaded and then uploaded again in encrypted form? or does it all happen on the server?

Rclone acts like the middle man for this because it's rclone that does the encryption so the encryption part happens where you run rclone so in this case, on the server if that helps.