Copied files in mounted file system appear after 5m

What is the problem you are having with rclone?

When I copy a file into a mounted file system, it does not appear immediately, but after 5 minutes.

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

clone v1.61.1

  • os/version: darwin 13.2.1 (64 bit)

  • os/kernel: 22.3.0 (x86_64)

  • os/type: darwin

  • os/arch: amd64

  • go/version: go1.19.4

  • go/linking: dynamic

  • go/tags: cmount

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

pCloud

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

rcloud mount pcloud: pCloud --daemon --vfs-cache-mode=writes
ls -l pCloud
rcloud copy file.txt pcloud:
ls -l pCloud

file.txt does not appear in the output of ls -l. Wait 5 minutes. Then again.

ls -l pCloud

Now file.txt appears in the output of ls -l. Alternativly, when I do

cp file.txt pCloud
ls -l

file.txt appears immediately in the output of ls -l.

The rclone config contents with secrets removed.

[pcloud]
type = pcloud
client_id = xxxx
client_secret = xxxx
hostname = eapi.pcloud.com
token = {"access_token":"xxxx","token_type":"bearer","expiry":"0001-01-01T00:00:00Z"}

A log from the command with the -vv flag

bernd@Bernds-Mac-mini ~ % rclone copy file.txt pcloud: -vv                     
2023/03/04 14:55:47 DEBUG : rclone: Version "v1.61.1" starting with parameters ["rclone" "copy" "file.txt" "pcloud:" "-vv"]
2023/03/04 14:55:47 DEBUG : Creating backend with remote "file.txt"
2023/03/04 14:55:47 DEBUG : Using config file from "/Users/bernd/.config/rclone/rclone.conf"
2023/03/04 14:55:47 DEBUG : fs cache: adding new entry for parent of "file.txt", "/Users/bernd"
2023/03/04 14:55:47 DEBUG : Creating backend with remote "pcloud:"
2023/03/04 14:55:48 DEBUG : file.txt: Need to transfer - File not found at Destination
2023/03/04 14:55:48 DEBUG : file.txt: sha1 = 046c168df2244d3a13985f042a50e479fe56455e OK
2023/03/04 14:55:48 INFO  : file.txt: Copied (new)
2023/03/04 14:55:48 INFO  : 
Transferred:   	          5 B / 5 B, 100%, 0 B/s, ETA -
Transferred:            1 / 1, 100%
Elapsed time:         0.2s

2023/03/04 14:55:48 DEBUG : 6 go routines active

hello and welcome to the fourm,

that is an interesting idea. but alas rclone does not do that yet.
so, as a kinda, sorta, concept idea, can do the following. i am not saying this is practical but think it would work.
to force rclone to update the cache for the rclone mount

  1. rclone copy file.txt pcloud:
  2. rclone rc vfs/refresh dir=pcloud:

If you run the mount with debug, you'll see pcloud is not a polling remote I'd imagine so it has to wait for the dir-cache-time to run by which is 5 minutes.

How could it know if someone else made a change somewhere without polling? The remote has to support polling for a change to be detected unless we have some --magic

The vfs/refresh command outputs the following:

bernd@Bernds-Mac-mini ~ % rclone rc vfs/refresh dir=pcloud: -vv    
2023/03/04 17:21:36 DEBUG : rclone: Version "v1.61.1" starting with parameters ["rclone" "rc" "vfs/refresh" "dir=pcloud:" "-vv"]
2023/03/04 17:21:36 DEBUG : 4 go routines active
2023/03/04 17:21:36 Failed to rc: connection failed: Post "http://localhost:5572/vfs/refresh": dial tcp [::1]:5572: connect: connection refused

to the mount command add
--rc --rc-no-auth

in that case, --magic :wink:

tho my idea, limited as it is, could do what the OP asked for.

or just an idea, some variation of:

  1. rclone mount remote: /mnt/remote --accept-cmd-updates
  2. rclone copy /path/to/source remote:

Why reinvent the wheel? The API is really the tool for that if the remote doesn't support polling. Your first suggestion was the easiest to do as it's already in existence.

I have played a bit with the rc command. The command

rclone mount pcloud: pCloud --daemon --vfs-cache-mode=writes --rc --rc-no-auth

does not mount because of the --daemon option. Without --daemon everything works, but

rclone rc mount/listmounts

does not show the mount point:

{
	"mountPoints": []
}

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