How to delete local cache automaticaly or download directly to mounted drive

STOP and READ USE THIS TEMPLATE NO EXCEPTIONS - By not using this, you waste your time, our time and really hate puppies. Please remove these two lines and that will confirm you have read them.

What is the problem you are having with rclone?

Local cache is not getting deleted automatically after the file has been uploaded to mounted OneDrive.

I am trying to download directly to onedrive from qbittorrent. Since onedrive doesn't support streamed uploads, local caching is unavoidable if i understood it correctly.

Run the command 'rclone version' and share the full output of the command.

rclone v1.65.2

  • os/version: Microsoft Windows Server 2022 Datacenter 21H2 (64 bit)
  • os/kernel: 10.0.20348.2227 (x86_64)
  • os/type: windows
  • os/arch: amd64
  • go/version: go1.21.6
  • go/linking: static
  • go/tags: cmount

Yes

Which cloud storage system are you using? (eg Google Drive)

SharePoint(OneDrive)

The command you were trying to run (eg rclone copy /tmp remote:tmp)

rclone mount stor: X: --vfs-cache-mode full --cache-dir E:\ --cache-tmp-upload-path E:\temp --cache-tmp-wait-time 10m


Please run 'rclone config redacted' and share the full output. If you get command not found, please make sure to update rclone.

[stor]
type = onedrive
token = XXX
drive_id = XXX
drive_type = business
### Double check the config for sensitive info before posting publicly

A log from the command that you were trying to run with the -vv flag

2024/01/28 10:27:00 DEBUG : /service-mbrs-ntscrm-00063365-00063365.mp4.crdownload: Write: ofst=599808281, fh=0x1
2024/01/28 10:27:00 DEBUG : service-mbrs-ntscrm-00063365-00063365.mp4.crdownload(0xc0002d2d40): _writeAt: size=57344, off=599808281
2024/01/28 10:27:00 DEBUG : service-mbrs-ntscrm-00063365-00063365.mp4.crdownload(0xc0002d2d40): >_writeAt: n=57344, err=<nil>
2024/01/28 10:27:00 DEBUG : /service-mbrs-ntscrm-00063365-00063365.mp4.crdownload: >Write: n=57344
2024/01/28 10:27:00 DEBUG : /service-mbrs-ntscrm-00063365-00063365.mp4.crdownload: Getattr: fh=0x1
2024/01/28 10:27:00 DEBUG : /service-mbrs-ntscrm-00063365-00063365.mp4.crdownload: >Getattr: errc=0
2024/01/28 10:27:00 DEBUG : /service-mbrs-ntscrm-00063365-00063365.mp4.crdownload: Write: ofst=599865625, fh=0x1
2024/01/28 10:27:00 DEBUG : service-mbrs-ntscrm-00063365-00063365.mp4.crdownload(0xc0002d2d40): _writeAt: size=32768, off=599865625
2024/01/28 10:27:00 DEBUG : service-mbrs-ntscrm-00063365-00063365.mp4.crdownload(0xc0002d2d40): >_writeAt: n=32768, err=<nil>
2024/01/28 10:27:00 DEBUG : /service-mbrs-ntscrm-00063365-00063365.mp4.crdownload: >Write: n=32768
2024/01/28 10:27:00 DEBUG : /service-mbrs-ntscrm-00063365-00063365.mp4.crdownload: Getattr: fh=0x1
2024/01/28 10:27:00 DEBUG : /service-mbrs-ntscrm-00063365-00063365.mp4.crdownload: >Getattr: errc=0
2024/01/28 10:27:00 DEBUG : /service-mbrs-ntscrm-00063365-00063365.mp4.crdownload: Write: ofst=599898393, fh=0x1
2024/01/28 10:27:00 DEBUG : service-mbrs-ntscrm-00063365-00063365.mp4.crdownload(0xc0002d2d40): _writeAt: size=24576, off=599898393
2024/01/28 10:27:00 DEBUG : service-mbrs-ntscrm-00063365-00063365.mp4.crdownload(0xc0002d2d40): >_writeAt: n=24576, err=<nil>
2024/01/28 10:27:00 DEBUG : /service-mbrs-ntscrm-00063365-00063365.mp4.crdownload: >Write: n=24576
2024/01/28 10:27:00 DEBUG : /service-mbrs-ntscrm-00063365-00063365.mp4.crdownload: Getattr: fh=0x1
2024/01/28 10:27:00 DEBUG : /service-mbrs-ntscrm-00063365-00063365.mp4.crdownload: >Getattr: errc=0
2024/01/28 10:27:00 DEBUG : /service-mbrs-ntscrm-00063365-00063365.mp4.crdownload: Write: ofst=599922969, fh=0x1
202

Default is 1 hour.

rclone mount

Those flags do nothing as they are for the cache backend.

I See. What mount command would you suggest to ensure the local cache is deleted automatically once the file upload to remote is completed ?

Really depends on what you want to happen.

--vfs-write-back duration              Time to writeback files after last use when using cache (default 5s)

Means it uploads in 5 seconds.

--vfs-cache-max-age duration           Max time since last access of objects in the cache (default 1h0m0s)

Means it stays there for 1 hour.

Configure them based on your requirements.

If your objective is to empty cache as soon as possible you can use:

--vfs-cache-max-age 1m --vfs-cache-max-size 1M

Flags explanation in docs.

It should delete uploaded file from cache in 1min max

Thanks, this worked.

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