Rclone Cache Setup question (encrypted)

Hello,

I just was able to setup my backup solution for my NAS and now I want to use Google Drive as additional storage for Plex.

Now as far as I understood I need to create a rclone cache ? Is that correct ? How do I do that and what to do then what/how exactly do I mount Google Drive to my NAS then?

I never used this before and thats why i need your advice.

This are my current remotes:
Name Type
==== ====
gcrypt crypt
gdrive drive

[gdrive]
type = drive
client_id = CLIENTID
client_secret = CLIENTSECRED
scope = drive
root_folder_id =
service_account_file =
token = {“access_token”:“TOKENHERE”,“token_type”:“Bearer”,“refresh_token”:“STUFFHERE”,“expiry”:“2018-09-04T14:28:17.678052133Z”}

and

[gcrypt]
type = crypt
remote = gdrive:/encrypt
filename_encryption = standard
directory_name_encryption = true
password = *** ENCRYPTED ***
password2 = *** ENCRYPTED ***

How does my rclone cache needs to look like ? So it works with plex?

Can my cache look like this would that work?

[gcache] type = cache
remote = gcrypt:/plex
plex_url = http://URL:1234
plex_username = USER
plex_password = *** ENCRYPTED ***
chunk_size = 5M
info_age = 24h
chunk_total_size = 10G

You have it backwards.

If you want to use cache, you need to cache your GD and mount the cache entry

There is a walk through here -> https://rclone.org/cache/#i-class-fa-fa-archive-i-cache-beta

But what if I want to have the cache encrypted aswell ? I mean I don’t want those files unecypted on google drive. Sorry if this is a stupid question, just want to be sure I understand correctly

[gcache] type = cache
remote = gdrive:/plex
plex_url = http://URL:1234
plex_username = USER
plex_password = *** ENCRYPTED ***
chunk_size = 5M
info_age = 24h
chunk_total_size = 10G

Go just a bit further down :slight_smile:

https://rclone.org/cache/#cache-and-crypt

[gdrive]
type = drive
client_id = CLIENTID
client_secret = CLIENTSECRED
scope = drive
root_folder_id =
service_account_file =
token = {“access_token”:“TOKENHERE”,“token_type”:“Bearer”,“refresh_token”:“STUFFHERE”,“expiry”:“2018-09-04T14:28:17.678052133Z”}

and

[gcrypt]
type = crypt
remote = gdrive:/encrypt
filename_encryption = standard
directory_name_encryption = true
password = *** ENCRYPTED ***
password2 = *** ENCRYPTED ***

[gcache]
type = cache
remote = gdrive:/encrypt
plex_url = http://IP:32400
plex_username = USER
plex_password = *** ENCRYPTED ***
chunk_size = 5M
info_age = 24h
chunk_total_size = 10G

I just set it up like this as far as I understood like this it is correct, right ?

Now I just need to mount it to the directory on my NAS right ?

rclone mount --allow-other gdrive: ~/share/folderforcache &

Or am I mistaken? I am confused.

But how does rclone then know to encrypt it ?

No, you got it backwards:

If you follow it, you have to cache your GD and your decrypt your cache and mount your crypt.

So it would be gdrive: as your base.
cache remote called gcache or something and cache your gdrive:
gcrypt mounts your gcache:
and you rclone mount the gcrypt

So you are mounting the decrypted -> cached -> gdrive.

I think I still understand everything completly wrong but please bear with my stupidity.

So first I create a gdrive config correct ?

Like this:
[gdrive]
type = drive
client_id = CLIENTID
client_secret = CLIENTSECRED
scope = drive
root_folder_id =
service_account_file =
token = {“access_token”:“TOKENHERE”,“token_type”:“Bearer”,“refresh_token”:“STUFFHERE”,“expiry”:“2018-09-04T14:28:17.678052133Z”}

Then I create the cache:
type = cache
remote = gdrive:/media
plex_url = http://IP:32400
plex_username = USER
plex_password = *** ENCRYPTED ***
chunk_size = 5M
info_age = 24h
chunk_total_size = 10G

then I create the crypt:
type = crypt
remote = gdrive:/media
filename_encryption = standard
directory_name_encryption = true
password = *** ENCRYPTED ***
password2 = *** ENCRYPTED ***

and then mount the crypt ? (i was following this https://bytesized-hosting.com/pages/rclone-gdrive)

If I still do not get it could you help me to change my config the correct way and tell me which mount command i need :sweat_smile:

For (dumb) users like me a GUI would be good, I rarely use command line and when I do I suck at it. (as you can see from my questions above)

That looks right based on the guide.

So then one last question do I need to run an extra command now to let gcrypt mount the gcache or is it already done in the config ? (because of same remote= gdrive:/media ) ?

Now I only need to mount the gcrypt right ?

Shouldn’t the remote for crypt be gcache: instead of gdrive:/media?

1 Like

Oh yes!

I was reading the guide that was posted and didn’t notice that.

The guide has really bad names in it for things…

I got everything correct, also the gcache thing:
but now I get this error when I try to mount it.

What does it mean ?
[/] # rclone mount --allow-other --allow-non-empty gcryptmedia: /External &
[2] 11753
[/] # 2018/09/04 20:58:23 ERROR : /root/.cache/rclone/cache-backend/gcache.db: Error opening storage cache. Is there another rclone running on the same remote? failed to open a cache connection to “/root/.cache/rclone/cache-backend/gcache.db”: timeout
2018/09/04 20:58:25 ERROR : /root/.cache/rclone/cache-backend/gcache.db: Error opening storage cache. Is there another rclone running on the same remote? failed to open a cache connection to “/root/.cache/rclone/cache-backend/gcache.db”: timeout
2018/09/04 20:58:25 Failed to create file system for “gcrypt:”: failed to make remote “gcache:/crypt” to wrap: failed to start cache db: failed to open a cache connection to “/root/.cache/rclone/cache-backend/gcache.db”: timeout

It means you have multiple rclones running and you need to stop the other ones as you can only have one cache running at a time.

How do I do that ?
And how to find out how many are running ?

You’d need to “ps -ef | grep rclone”

Look for a process ID for rclone and kill that process id.

Just to be sure when using this command: rclone mount --allow-other --allow-non-empty gcrypt: /External &

Can I then also drop files into that folder so they get uploaded?

Can you repost your final rclone.conf you are using? The names were goofy before and it would be good to ensure you have the order of operations right.

[gdrive]
type = drive
client_id = IDHERE
client_secret = SECRETHERE
scope = drive
root_folder_id =
service_account_file =
token = {“access_token”:“TOKENHERE”,“token_type”:“Bearer”,“refresh_token”:“STUFFHERE”,“expiry”:“2018-09-04T19:27:33.56122287Z”}

[gcryptmedia]
type = crypt
remote = gcache:/crypt
filename_encryption = standard
directory_name_encryption = true
password = pw1
password2 = pw2

[gcache]
type = cache
remote = gdrive:/media
plex_url = http://IP:32400
plex_username = USER
plex_password = plexpw
chunk_size = 5M
info_age = 1d
chunk_total_size = 10G

When trying the mount command now I get this:

rclone mount --allow-other --allow-non-empty gcryptmedia: /External --vfs-cache-mode writes
2018/09/04 19:17:09 Failed to create file system for “gcryptmedia:”: failed to make remote “gcache:/crypt” to wrap: failed to understand duration 1d: time: unknown unit d in duration 1d

Accepted units are: “s”, “m”, “h”.

Source: https://rclone.org/cache/