github.com/xhghs/rclone@v1.51.1-0.20200430155106-e186a28cced8/vfs/help.go (about) 1 package vfs 2 3 // Help contains text describing file and directory caching to add to 4 // the command help. 5 var Help = ` 6 ### Directory Cache 7 8 Using the ` + "`--dir-cache-time`" + ` flag, you can set how long a 9 directory should be considered up to date and not refreshed from the 10 backend. Changes made locally in the mount may appear immediately or 11 invalidate the cache. However, changes done on the remote will only 12 be picked up once the cache expires. 13 14 Alternatively, you can send a ` + "`SIGHUP`" + ` signal to rclone for 15 it to flush all directory caches, regardless of how old they are. 16 Assuming only one rclone instance is running, you can reset the cache 17 like this: 18 19 kill -SIGHUP $(pidof rclone) 20 21 If you configure rclone with a [remote control](/rc) then you can use 22 rclone rc to flush the whole directory cache: 23 24 rclone rc vfs/forget 25 26 Or individual files or directories: 27 28 rclone rc vfs/forget file=path/to/file dir=path/to/dir 29 30 ### File Buffering 31 32 The ` + "`--buffer-size`" + ` flag determines the amount of memory, 33 that will be used to buffer data in advance. 34 35 Each open file descriptor will try to keep the specified amount of 36 data in memory at all times. The buffered data is bound to one file 37 descriptor and won't be shared between multiple open file descriptors 38 of the same file. 39 40 This flag is a upper limit for the used memory per file descriptor. 41 The buffer will only use memory for data that is downloaded but not 42 not yet read. If the buffer is empty, only a small amount of memory 43 will be used. 44 The maximum memory used by rclone for buffering can be up to 45 ` + "`--buffer-size * open files`" + `. 46 47 ### File Caching 48 49 These flags control the VFS file caching options. The VFS layer is 50 used by rclone mount to make a cloud storage system work more like a 51 normal file system. 52 53 You'll need to enable VFS caching if you want, for example, to read 54 and write simultaneously to a file. See below for more details. 55 56 Note that the VFS cache works in addition to the cache backend and you 57 may find that you need one or the other or both. 58 59 --cache-dir string Directory rclone will use for caching. 60 --vfs-cache-max-age duration Max age of objects in the cache. (default 1h0m0s) 61 --vfs-cache-mode string Cache mode off|minimal|writes|full (default "off") 62 --vfs-cache-poll-interval duration Interval to poll the cache for stale objects. (default 1m0s) 63 --vfs-cache-max-size int Max total size of objects in the cache. (default off) 64 65 If run with ` + "`-vv`" + ` rclone will print the location of the file cache. The 66 files are stored in the user cache file area which is OS dependent but 67 can be controlled with ` + "`--cache-dir`" + ` or setting the appropriate 68 environment variable. 69 70 The cache has 4 different modes selected by ` + "`--vfs-cache-mode`" + `. 71 The higher the cache mode the more compatible rclone becomes at the 72 cost of using disk space. 73 74 Note that files are written back to the remote only when they are 75 closed so if rclone is quit or dies with open files then these won't 76 get written back to the remote. However they will still be in the on 77 disk cache. 78 79 If using --vfs-cache-max-size note that the cache may exceed this size 80 for two reasons. Firstly because it is only checked every 81 --vfs-cache-poll-interval. Secondly because open files cannot be 82 evicted from the cache. 83 84 #### --vfs-cache-mode off 85 86 In this mode the cache will read directly from the remote and write 87 directly to the remote without caching anything on disk. 88 89 This will mean some operations are not possible 90 91 * Files can't be opened for both read AND write 92 * Files opened for write can't be seeked 93 * Existing files opened for write must have O_TRUNC set 94 * Files open for read with O_TRUNC will be opened write only 95 * Files open for write only will behave as if O_TRUNC was supplied 96 * Open modes O_APPEND, O_TRUNC are ignored 97 * If an upload fails it can't be retried 98 99 #### --vfs-cache-mode minimal 100 101 This is very similar to "off" except that files opened for read AND 102 write will be buffered to disks. This means that files opened for 103 write will be a lot more compatible, but uses the minimal disk space. 104 105 These operations are not possible 106 107 * Files opened for write only can't be seeked 108 * Existing files opened for write must have O_TRUNC set 109 * Files opened for write only will ignore O_APPEND, O_TRUNC 110 * If an upload fails it can't be retried 111 112 #### --vfs-cache-mode writes 113 114 In this mode files opened for read only are still read directly from 115 the remote, write only and read/write files are buffered to disk 116 first. 117 118 This mode should support all normal file system operations. 119 120 If an upload fails it will be retried up to --low-level-retries times. 121 122 #### --vfs-cache-mode full 123 124 In this mode all reads and writes are buffered to and from disk. When 125 a file is opened for read it will be downloaded in its entirety first. 126 127 This may be appropriate for your needs, or you may prefer to look at 128 the cache backend which does a much more sophisticated job of caching, 129 including caching directory hierarchies and chunks of files. 130 131 In this mode, unlike the others, when a file is written to the disk, 132 it will be kept on the disk after it is written to the remote. It 133 will be purged on a schedule according to ` + "`--vfs-cache-max-age`" + `. 134 135 This mode should support all normal file system operations. 136 137 If an upload or download fails it will be retried up to 138 --low-level-retries times. 139 `