github.com/10XDev/rclone@v1.52.3-0.20200626220027-16af9ab76b2a/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 if the backend configured does not 13 support polling for changes. If the backend supports polling, changes 14 will be picked up on within the polling interval. 15 16 Alternatively, you can send a ` + "`SIGHUP`" + ` signal to rclone for 17 it to flush all directory caches, regardless of how old they are. 18 Assuming only one rclone instance is running, you can reset the cache 19 like this: 20 21 kill -SIGHUP $(pidof rclone) 22 23 If you configure rclone with a [remote control](/rc) then you can use 24 rclone rc to flush the whole directory cache: 25 26 rclone rc vfs/forget 27 28 Or individual files or directories: 29 30 rclone rc vfs/forget file=path/to/file dir=path/to/dir 31 32 ### File Buffering 33 34 The ` + "`--buffer-size`" + ` flag determines the amount of memory, 35 that will be used to buffer data in advance. 36 37 Each open file descriptor will try to keep the specified amount of 38 data in memory at all times. The buffered data is bound to one file 39 descriptor and won't be shared between multiple open file descriptors 40 of the same file. 41 42 This flag is a upper limit for the used memory per file descriptor. 43 The buffer will only use memory for data that is downloaded but not 44 not yet read. If the buffer is empty, only a small amount of memory 45 will be used. 46 The maximum memory used by rclone for buffering can be up to 47 ` + "`--buffer-size * open files`" + `. 48 49 ### File Caching 50 51 These flags control the VFS file caching options. The VFS layer is 52 used by rclone mount to make a cloud storage system work more like a 53 normal file system. 54 55 You'll need to enable VFS caching if you want, for example, to read 56 and write simultaneously to a file. See below for more details. 57 58 Note that the VFS cache works in addition to the cache backend and you 59 may find that you need one or the other or both. 60 61 --cache-dir string Directory rclone will use for caching. 62 --vfs-cache-max-age duration Max age of objects in the cache. (default 1h0m0s) 63 --vfs-cache-mode string Cache mode off|minimal|writes|full (default "off") 64 --vfs-cache-poll-interval duration Interval to poll the cache for stale objects. (default 1m0s) 65 --vfs-cache-max-size int Max total size of objects in the cache. (default off) 66 67 If run with ` + "`-vv`" + ` rclone will print the location of the file cache. The 68 files are stored in the user cache file area which is OS dependent but 69 can be controlled with ` + "`--cache-dir`" + ` or setting the appropriate 70 environment variable. 71 72 The cache has 4 different modes selected by ` + "`--vfs-cache-mode`" + `. 73 The higher the cache mode the more compatible rclone becomes at the 74 cost of using disk space. 75 76 Note that files are written back to the remote only when they are 77 closed so if rclone is quit or dies with open files then these won't 78 get written back to the remote. However they will still be in the on 79 disk cache. 80 81 If using --vfs-cache-max-size note that the cache may exceed this size 82 for two reasons. Firstly because it is only checked every 83 --vfs-cache-poll-interval. Secondly because open files cannot be 84 evicted from the cache. 85 86 #### --vfs-cache-mode off 87 88 In this mode the cache will read directly from the remote and write 89 directly to the remote without caching anything on disk. 90 91 This will mean some operations are not possible 92 93 * Files can't be opened for both read AND write 94 * Files opened for write can't be seeked 95 * Existing files opened for write must have O_TRUNC set 96 * Files open for read with O_TRUNC will be opened write only 97 * Files open for write only will behave as if O_TRUNC was supplied 98 * Open modes O_APPEND, O_TRUNC are ignored 99 * If an upload fails it can't be retried 100 101 #### --vfs-cache-mode minimal 102 103 This is very similar to "off" except that files opened for read AND 104 write will be buffered to disks. This means that files opened for 105 write will be a lot more compatible, but uses the minimal disk space. 106 107 These operations are not possible 108 109 * Files opened for write only can't be seeked 110 * Existing files opened for write must have O_TRUNC set 111 * Files opened for write only will ignore O_APPEND, O_TRUNC 112 * If an upload fails it can't be retried 113 114 #### --vfs-cache-mode writes 115 116 In this mode files opened for read only are still read directly from 117 the remote, write only and read/write files are buffered to disk 118 first. 119 120 This mode should support all normal file system operations. 121 122 If an upload fails it will be retried up to --low-level-retries times. 123 124 #### --vfs-cache-mode full 125 126 In this mode all reads and writes are buffered to and from disk. When 127 a file is opened for read it will be downloaded in its entirety first. 128 129 This may be appropriate for your needs, or you may prefer to look at 130 the cache backend which does a much more sophisticated job of caching, 131 including caching directory hierarchies and chunks of files. 132 133 In this mode, unlike the others, when a file is written to the disk, 134 it will be kept on the disk after it is written to the remote. It 135 will be purged on a schedule according to ` + "`--vfs-cache-max-age`" + `. 136 137 This mode should support all normal file system operations. 138 139 If an upload or download fails it will be retried up to 140 --low-level-retries times. 141 142 ### Case Sensitivity 143 144 Linux file systems are case-sensitive: two files can differ only 145 by case, and the exact case must be used when opening a file. 146 147 Windows is not like most other operating systems supported by rclone. 148 File systems in modern Windows are case-insensitive but case-preserving: 149 although existing files can be opened using any case, the exact case used 150 to create the file is preserved and available for programs to query. 151 It is not allowed for two files in the same directory to differ only by case. 152 153 Usually file systems on macOS are case-insensitive. It is possible to make macOS 154 file systems case-sensitive but that is not the default 155 156 The "--vfs-case-insensitive" mount flag controls how rclone handles these 157 two cases. If its value is "false", rclone passes file names to the mounted 158 file system as is. If the flag is "true" (or appears without a value on 159 command line), rclone may perform a "fixup" as explained below. 160 161 The user may specify a file name to open/delete/rename/etc with a case 162 different than what is stored on mounted file system. If an argument refers 163 to an existing file with exactly the same name, then the case of the existing 164 file on the disk will be used. However, if a file name with exactly the same 165 name is not found but a name differing only by case exists, rclone will 166 transparently fixup the name. This fixup happens only when an existing file 167 is requested. Case sensitivity of file names created anew by rclone is 168 controlled by an underlying mounted file system. 169 170 Note that case sensitivity of the operating system running rclone (the target) 171 may differ from case sensitivity of a file system mounted by rclone (the source). 172 The flag controls whether "fixup" is performed to satisfy the target. 173 174 If the flag is not provided on command line, then its default value depends 175 on the operating system where rclone runs: "true" on Windows and macOS, "false" 176 otherwise. If the flag is provided without a value, then it is "true". 177 `