Need more info about --vfs-cache-mode writes

Edit (suggested by @kapitainsky)

Usage explained. I basically take some math notes on Obsidian, I had once lost all my documents, so I am trying to avoid that mistake and sync my documents folder. Since these are documents folders, all the files are texts, thus, it takes very little to actually sync them between local documents folder and mega drive I am using. btw there are some pdf files whose size is close to 50mbs and such.

What I am trying to do: just want to make sure everyday my documents are synced and I don't lose any data. I do it at the end of the day when I am not taking any notes, so I am ok if the files are inaccessible for a few mins of time (it won't take a lot of time to sync few mbs)

$ rclone version
rclone v1.63.1
- os/version: debian 11.7 (64 bit)
- os/kernel: 6.0.0-6mx-amd64 (x86_64)
- os/type: linux
- os/arch: amd64
- go/version: go1.20.6
- go/linking: static
- go/tags: none
$ rclone config redacted
[demo]
type = crypt
remote = mega_sync:/demo/
directory_name_encryption = false
password = XXX
filename_encryption = off

[mega_sync]
type = mega
user = XXX
pass = XXX

[solids]
type = crypt
remote = mega_sync:/solids/
password = XXX
### Double check the config for sensitive info before posting publicly


Original Post
DISCLOSURE: I am not a very techy guy and my first language isn't English so please don't judge :frowning:

Below is the command I was using and my limited daily data quota was exhausted within mins due to this

rclone mount solids: /home/bob/Documents/ --vfs-cache-mode writes --allow-non-empty -P -vv 

I removed the --vfs-cache-mode writes part and data is being conserved right now. I have not included any config files or log as I believe these are irrelevant to my question.

I need your help understand what --vfs-cache-mode writes does.

I understand that this is somewhat of a buffering command, if you are using a file and you want to backit up as you edit it, you should use this. If however, you are backing up something and you don't use this, then you would lose write access to the folder you are syncing. Am I correct?

I have very limited data and rclone has been eating data like crazy for a few days now and after I have removed --vfs-cache-mode writes from my command, it works well right now.
i.e., I can't edit the files as they are being uploaded but I don't need to as I am backing up my documents folder which are filled with .md and .tex files who's size is little less than 1mb at the most.

Also, is there a command to pkill rclone as soon as it finds that everything in my documents folder has been synced with my drive folder?

Thank you to everyone who replies! I am grateful for rclone thank you to all devs and sponsors

I would suggest that if you do not understand technical side of VFS caching maybe you explain what you are doing and what you want to achieve. Then somebody can suggest appropriate solution and mount settings.

VFS cache level does not "conserve" any data - so there is something else happening here.

As you are not sure what is going on you better provide too much than too little....

Provide:

rclone version

and

rclone config redacted

Short answer is no.

1 Like
  1. Update your rclone to the latest version

sudo rclone selfupdate --stable

  1. post result of:

rclone config redacted

1 Like

thank you @kapitainsky I didn't know how to update the package before. I have edited the post with what you had asked.

Can you explain what you want to achieve? Maybe you do not need mount at all? As what is its point without any cache?

I am trying to sync the files which I have modified (let's say I wrote more notes in my file)or created files (I might have copied pdfs from another folder or might have created a .md or .tex file) during the day at the end of the day.

At the end of the day, I just want my days work to be saved in mega. I am "syncing" but the interval for the "sync" I am doing is a day. Do I need mount?

For what you described I think the best approach would be to run:

rclone sync /path/to/files solids:

If you want to track changes add --backup-dir

You can configure your sync task to run for example at night - you can use cron or systemd.

Mount is great if you want to access files - not so great to run backups (as e.g. you never know when it is finished)

1 Like

thank you very much! That's very helpful! Also, am I right about the use of --vfs-cache-mode writes

You helped me a lot today, I just want to mark a solution and sleep rn :')

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