Box Remote mounts and functions but doesn't auto refresh content

Thanks upfront for anyone who can take a look. If anyone uses box with a VFS service, please reply with you service file with Box.com.

What is the problem you are having with rclone?

I have rclone set up to mount a box.com account. I am able to se this setup in my listremotes command as expected. Using a command such as rclone copy google:/test chunker_remote: works as expected (files copy over and appear in the box.com web UI as encrypted files).

I am mounting the rclone remote with a service file, and I used the same one from a Google Drive remote and it is causing issues. I am able to mount the remote and view the files that are on it. However, if I add files to the remote via the above rclone command or a rclone move command, the files successfully add to the remote however what I can see mounted on my filesystem does not show the newly added data. I still see the file structure as it was when I initially ran the mount service, and to see the new data I need to reload the mount service. I can verify things move over via the Box.com webUI as well as the rclone lsd command.

I am looking for an rclone VFS service template that I can use with Box.com.

Here is the template I'm currently using. Permissions on /mnt/box are myuser:myuser, the same as the other folders in /mnt.

[Unit]
Description=Rclone VFS Mount
After=network-online.target

[Service]
User=myuser
Group=myuser
Type=notify
ExecStartPre=/bin/sleep 10
ExecStart=/usr/bin/rclone mount \
  --user-agent='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gec>
  --config=/home/myuser/.config/rclone/rclone.conf \
  --allow-other \
  --rc \
  --rc-no-auth \
  --rc-addr=localhost:5573 \
  --drive-skip-gdocs \
  --vfs-read-chunk-size=64M \
  --vfs-read-chunk-size-limit=2048M \
  --buffer-size=64M \
  --poll-interval=15s \
  --dir-cache-time=1000h \
  --timeout=10m \
  --drive-chunk-size=64M \
  --drive-pacer-min-sleep=10ms \
  --drive-pacer-burst=1000 \
  --umask=002 \
  --syslog \
  -v \
  chunker_remote: /mnt/box
ExecStartPost=/usr/bin/rclone rc vfs/refresh recursive=true --url http://localhost:5573 _asyn>
ExecStop=/bin/fusermount -uz /mnt/box
Restart=on-abort
RestartSec=5
StartLimitInterval=60s
StartLimitBurst=3

[Install]
WantedBy=default.target

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

rclone v1.61.1
- os/version: ubuntu 22.04 (64 bit)
- os/kernel: 5.15.0-78-generic (x86_64)
- os/type: linux
- os/arch: amd64
- go/version: go1.19.4
- go/linking: static
- go/tags: none

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

The rclone config contents with secrets removed.

[google]
type = drive
client_id = *.apps.googleusercontent.com
client_secret = *
scope = drive
token = {"access_token":"*","token_type":"Bearer","refresh_token":"1//01_*","expiry":"2023-08-04T23:57:54.15060509-04:00"}
team_drive = *

[box_remote]
type = box
token = {"access_token":"*","token_type":"bearer","refresh_token":"*","expiry":"2023-08-05T00:04:14.56420928-04:00"}

[crypt_remote]
type = crypt
remote = box_remote:data
password = *
password2 = *
filename_encoding = base32768

[chunker_remote]
type = chunker
remote = crypt_remote:
chunk_size = 4Gi
name_format = *.rcc###
hash_type = sha1all

Thank you for creating separate thread.

It is BTW well thought systemd service file for gdrive mount.

Box is not polling remote (you can remove --poll-interval=15s flag) changes from the remote are only picked up after time set by this flag:

--dir-cache-time duration   Time to cache directory entries for (default 5m0s)

you set it to --dir-cache-time=1000h so it is indeed slow:) On Google Drive polling worked but unfortunately not with Box.

You can remove as well:

  --drive-chunk-size=64M \
  --drive-pacer-min-sleep=10ms \
  --drive-pacer-burst=1000 \

these flags are only applicable to Google Drive (hence drive- in their names).

To control API calls limits you could add:

  # Set the tpslimit
  --tpslimit 15 \
  # Set the tpslimit-burst
  --tpslimit-burst 0 \

feel free to experiment with --tpslimit value. I think 15 is good start but only live tests can tell.

PS. Rclone is now v1.63.1 - you are little behind with 1.62.1. I would actually recommend for box beta v1.64 - as things are actively fixed now with box getting more popular:

sudo -v ; curl https://rclone.org/install.sh | sudo bash -s beta

When it is released you can switch to stable by running:

sudo rclone selfupdate --stable
1 Like

Thank you. That helped a lot. I changed the refresh interval to 5m and it seems to be working so far. Here is my VFS service file.

[Unit]
Description=Rclone VFS Mount
After=network-online.target

[Service]
User=myuser
Group=myuser
Type=notify
ExecStartPre=/bin/sleep 10
ExecStart=/usr/bin/rclone mount \
  --user-agent='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.131 >
  --config=/home/myuser/.config/rclone/rclone.conf \
  --allow-other \
  --rc \
  --rc-no-auth \
  --rc-addr=localhost:5573 \
  --vfs-read-chunk-size=128M \
  --vfs-read-chunk-size-limit=off \
  --buffer-size=1G \
  --dir-cache-time=5m0s \
  --tpslimit 15 \
  --tpslimit-burst 0 \
  --fast-list \
  --syslog \
  -v \
  chunker_remote: /mnt/box
ExecStartPost=/usr/bin/rclone rc vfs/refresh recursive=true --url http://localhost:5573 _async=true
ExecStop=/bin/fusermount -uz /mnt/box
Restart=on-abort
RestartSec=5
StartLimitInterval=60s
StartLimitBurst=3

[Install]
WantedBy=default.target

edit: I guess I'll ask - is there a better/recommended way to mount the box drive onto my local filesystem? The service file worked great for google with drive polling, but without it, I just thought I'd ask to see if there was a community preferred way.

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