Can not remove files from vfs cache

What is the problem you are having with rclone?

I'm trying to delete files from VFS cache.
Can someone explain me how does the rclone rc vfs/refresh and rclone rc vfs/forget work?
Either the refresh or forget does work or am I misunderstanding something?
Currenty I'm deleting the files manually in the VFS cache directory.

What is your rclone version (output from rclone version)

rclone v1.54.0

  • os/arch: linux/amd64
  • go version: go1.15.7

Which OS you are using and how many bits (eg Windows 7, 64 bit)

No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.2 LTS
Release: 20.04
Codename: focal

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

Google Drive

The rclone config contents with secrets removed.

rclone rc vfs/refresh recursive=true _async=true
rclone rc vfs/forget dir="A_SERIES_DIRECTORY"

The rclone config contents with secrets removed.

[gdrive_1]
type = drive
scope = drive
root_folder_id = .....
service_account_file = .....
team_drive = .....

# google drives remotes as union
[gdrive_union]
type = union
remotes = gdrive_1: gdrive_2: gdrive_3: ....

# remote for mount
[gdrive_alias]
type = alias
remote = gdrive_union:/
/usr/bin/rclone mount \
    --drive-impersonate EMAIL \
    --config CONFIG \
    --allow-non-empty \
    --allow-other \
    --umask 002 \
    --daemon \
    --user-agent "DRiiFT_KiinG" \
    --verbose \
    --verbose \
    --log-file /var/log/rclone.log \
    --rc \
    --rc-addr 127.0.0.1:5572 \
    --rc-no-auth \
    --copy-links \
    --buffer-size 16M \
    --dir-cache-time 1000h \
    --poll-interval 15s \
    --cache-dir=/vfs-cache \
    --vfs-cache-mode full \
    --vfs-cache-max-size 512G \
    --vfs-cache-max-age 336h \
    gdrive_alias: /mount_path

You don't delete files from the cache area. Once the time expires and they are not in used, they are removed. Yours stay in there for 336 hours.

You will cause problems by manually deleting.

I know, but how do I get rid off those files from the cache, when they are removed over the Google Drive WebGui?

I have removed some files over the Google Drive WebGui, but they were still availabe in the cache.
I thought the GoogleDrive is a polling drive and would remove those files automatically?

I have also tried the forget and refresh comans of remote control, but havenā€˜t worked also.

You'd have to include a debug log and replicate the issue as it's kind of a guessing game of what is going on.

OK, I will create a sandbox system and will deliver later the debug log.

Would you agree the simple steps would be:

  1. Have a testfile on Google Drive
  2. Read testfile locally on rclone
  3. Delete file from Google Drive
  4. What happens with testfile in cache locally on rclone

Does that seem right?

Ok, the file does not exist in the remote after the deletion, but still exist in the cache dir.

I think, I was expecting that the file is also removed in the cache directory and at the moment I saw that a file still exists in the cache, I haven't controlled the remote itself.

I think its working :slight_smile:

Question: But why is the file in cache not removed?

@Animosity022: But I have still a question:

  1. What should happen, when I call rclone rc vfs/forget?
  2. And I think this command (rclone rc vfs/refresh recursive=true _async=true), will mark all files and directories as invalid right?

Both of those don't do anything to the cache as that only 'forgets' your directory / file structure in memory.

@Animosity022: Ok, thank you for those informations :+1:

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