Cache: files are deleted after upload?

Hi,
according to my understanding, when using cache back-end and tmp_upload_path, files are stored in temp path and queued to upload after tmp_wait_time. During this time files are available in cache and served from local dir.
When files are uploaded to remote backed they are deleted from tmp_upload_path and not available in cache anymore. When accessed they need to be downloaded from remote regardless of chunk_total_size.

Is my understanding correct? Is there anything I can do to tell rclone to keep uploaded files in cache?

rclone v1.51.0
- os/arch: linux/amd64
- go version: go1.13.6

[gdrive]
type = drive
client_id = XXXXXXXXXXXXXXXX
client_secret = XXXXXXXXXXXXXXXX
scope = drive
token = XXXXXXXXXXXXXXXX
acknowledge_abuse = true
disable_http2 = false

[gdrive-cache]
type = cache
remote = gdrive:
info_age = 96h
chunk_total_size = 512G
tmp_upload_path = /opt/rclone/cache-tmp
tmp_wait_time = 30m
db_purge = false

[gdrive-crypt]
type = crypt
remote = gdrive-cache:
filename_encryption = standard
directory_name_encryption = true
password = XXXXXXXXXXXXXXXX
password2 = XXXXXXXXXXXXXXXX

rclone --rc --rc-web-gui --rc-web-gui-no-open-browser --timeout 10m mount --allow-other --attr-timeout 10s --umask 002 --no-modtime --dir-cache-time 24h gdrive-crypt: /mnt/drive

I've looked at code and indeed, files are removed just after they are successfully uploaded.
After tmp_wait_time files are moved (copy and remove) to remote. After this operation empty folders that left in cache are removed and upload is removed from queue.

As I don't have a lot of experience in Go:
how difficult it will be to change logic to copy files to remote and remove upload from queue. Then remove uploaded files and folders in CleanChunksBySize()?

We don't currently have a cache backend maintainer, so I'd consider the code frozen unless you were thinking of doing it yourself :frowning:

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.