github.com/artpar/rclone@v1.67.3/docs/content/commands/rclone_serve_dlna.md (about)

     1  ---
     2  title: "rclone serve dlna"
     3  description: "Serve remote:path over DLNA"
     4  slug: rclone_serve_dlna
     5  url: /commands/rclone_serve_dlna/
     6  groups: Filter
     7  versionIntroduced: v1.46
     8  # autogenerated - DO NOT EDIT, instead edit the source code in cmd/serve/dlna/ and as part of making a release run "make commanddocs"
     9  ---
    10  # rclone serve dlna
    11  
    12  Serve remote:path over DLNA
    13  
    14  ## Synopsis
    15  
    16  Run a DLNA media server for media stored in an rclone remote. Many
    17  devices, such as the Xbox and PlayStation, can automatically discover
    18  this server in the LAN and play audio/video from it. VLC is also
    19  supported. Service discovery uses UDP multicast packets (SSDP) and
    20  will thus only work on LANs.
    21  
    22  Rclone will list all files present in the remote, without filtering
    23  based on media formats or file extensions. Additionally, there is no
    24  media transcoding support. This means that some players might show
    25  files that they are not able to play back correctly.
    26  
    27  
    28  ## Server options
    29  
    30  Use `--addr` to specify which IP address and port the server should
    31  listen on, e.g. `--addr 1.2.3.4:8000` or `--addr :8080` to listen to all
    32  IPs.
    33  
    34  Use `--name` to choose the friendly server name, which is by
    35  default "rclone (hostname)".
    36  
    37  Use `--log-trace` in conjunction with `-vv` to enable additional debug
    38  logging of all UPNP traffic.
    39  
    40  ## VFS - Virtual File System
    41  
    42  This command uses the VFS layer. This adapts the cloud storage objects
    43  that rclone uses into something which looks much more like a disk
    44  filing system.
    45  
    46  Cloud storage objects have lots of properties which aren't like disk
    47  files - you can't extend them or write to the middle of them, so the
    48  VFS layer has to deal with that. Because there is no one right way of
    49  doing this there are various options explained below.
    50  
    51  The VFS layer also implements a directory cache - this caches info
    52  about files and directories (but not the data) in memory.
    53  
    54  ## VFS Directory Cache
    55  
    56  Using the `--dir-cache-time` flag, you can control how long a
    57  directory should be considered up to date and not refreshed from the
    58  backend. Changes made through the VFS will appear immediately or
    59  invalidate the cache.
    60  
    61      --dir-cache-time duration   Time to cache directory entries for (default 5m0s)
    62      --poll-interval duration    Time to wait between polling for changes. Must be smaller than dir-cache-time. Only on supported remotes. Set to 0 to disable (default 1m0s)
    63  
    64  However, changes made directly on the cloud storage by the web
    65  interface or a different copy of rclone will only be picked up once
    66  the directory cache expires if the backend configured does not support
    67  polling for changes. If the backend supports polling, changes will be
    68  picked up within the polling interval.
    69  
    70  You can send a `SIGHUP` signal to rclone for it to flush all
    71  directory caches, regardless of how old they are.  Assuming only one
    72  rclone instance is running, you can reset the cache like this:
    73  
    74      kill -SIGHUP $(pidof rclone)
    75  
    76  If you configure rclone with a [remote control](/rc) then you can use
    77  rclone rc to flush the whole directory cache:
    78  
    79      rclone rc vfs/forget
    80  
    81  Or individual files or directories:
    82  
    83      rclone rc vfs/forget file=path/to/file dir=path/to/dir
    84  
    85  ## VFS File Buffering
    86  
    87  The `--buffer-size` flag determines the amount of memory,
    88  that will be used to buffer data in advance.
    89  
    90  Each open file will try to keep the specified amount of data in memory
    91  at all times. The buffered data is bound to one open file and won't be
    92  shared.
    93  
    94  This flag is a upper limit for the used memory per open file.  The
    95  buffer will only use memory for data that is downloaded but not not
    96  yet read. If the buffer is empty, only a small amount of memory will
    97  be used.
    98  
    99  The maximum memory used by rclone for buffering can be up to
   100  `--buffer-size * open files`.
   101  
   102  ## VFS File Caching
   103  
   104  These flags control the VFS file caching options. File caching is
   105  necessary to make the VFS layer appear compatible with a normal file
   106  system. It can be disabled at the cost of some compatibility.
   107  
   108  For example you'll need to enable VFS caching if you want to read and
   109  write simultaneously to a file.  See below for more details.
   110  
   111  Note that the VFS cache is separate from the cache backend and you may
   112  find that you need one or the other or both.
   113  
   114      --cache-dir string                     Directory rclone will use for caching.
   115      --vfs-cache-mode CacheMode             Cache mode off|minimal|writes|full (default off)
   116      --vfs-cache-max-age duration           Max time since last access of objects in the cache (default 1h0m0s)
   117      --vfs-cache-max-size SizeSuffix        Max total size of objects in the cache (default off)
   118      --vfs-cache-min-free-space SizeSuffix  Target minimum free space on the disk containing the cache (default off)
   119      --vfs-cache-poll-interval duration     Interval to poll the cache for stale objects (default 1m0s)
   120      --vfs-write-back duration              Time to writeback files after last use when using cache (default 5s)
   121  
   122  If run with `-vv` rclone will print the location of the file cache.  The
   123  files are stored in the user cache file area which is OS dependent but
   124  can be controlled with `--cache-dir` or setting the appropriate
   125  environment variable.
   126  
   127  The cache has 4 different modes selected by `--vfs-cache-mode`.
   128  The higher the cache mode the more compatible rclone becomes at the
   129  cost of using disk space.
   130  
   131  Note that files are written back to the remote only when they are
   132  closed and if they haven't been accessed for `--vfs-write-back`
   133  seconds. If rclone is quit or dies with files that haven't been
   134  uploaded, these will be uploaded next time rclone is run with the same
   135  flags.
   136  
   137  If using `--vfs-cache-max-size` or `--vfs-cache-min-free-size` note
   138  that the cache may exceed these quotas for two reasons. Firstly
   139  because it is only checked every `--vfs-cache-poll-interval`. Secondly
   140  because open files cannot be evicted from the cache. When
   141  `--vfs-cache-max-size` or `--vfs-cache-min-free-size` is exceeded,
   142  rclone will attempt to evict the least accessed files from the cache
   143  first. rclone will start with files that haven't been accessed for the
   144  longest. This cache flushing strategy is efficient and more relevant
   145  files are likely to remain cached.
   146  
   147  The `--vfs-cache-max-age` will evict files from the cache
   148  after the set time since last access has passed. The default value of
   149  1 hour will start evicting files from cache that haven't been accessed
   150  for 1 hour. When a cached file is accessed the 1 hour timer is reset to 0
   151  and will wait for 1 more hour before evicting. Specify the time with
   152  standard notation, s, m, h, d, w .
   153  
   154  You **should not** run two copies of rclone using the same VFS cache
   155  with the same or overlapping remotes if using `--vfs-cache-mode > off`.
   156  This can potentially cause data corruption if you do. You can work
   157  around this by giving each rclone its own cache hierarchy with
   158  `--cache-dir`. You don't need to worry about this if the remotes in
   159  use don't overlap.
   160  
   161  ### --vfs-cache-mode off
   162  
   163  In this mode (the default) the cache will read directly from the remote and write
   164  directly to the remote without caching anything on disk.
   165  
   166  This will mean some operations are not possible
   167  
   168    * Files can't be opened for both read AND write
   169    * Files opened for write can't be seeked
   170    * Existing files opened for write must have O_TRUNC set
   171    * Files open for read with O_TRUNC will be opened write only
   172    * Files open for write only will behave as if O_TRUNC was supplied
   173    * Open modes O_APPEND, O_TRUNC are ignored
   174    * If an upload fails it can't be retried
   175  
   176  ### --vfs-cache-mode minimal
   177  
   178  This is very similar to "off" except that files opened for read AND
   179  write will be buffered to disk.  This means that files opened for
   180  write will be a lot more compatible, but uses the minimal disk space.
   181  
   182  These operations are not possible
   183  
   184    * Files opened for write only can't be seeked
   185    * Existing files opened for write must have O_TRUNC set
   186    * Files opened for write only will ignore O_APPEND, O_TRUNC
   187    * If an upload fails it can't be retried
   188  
   189  ### --vfs-cache-mode writes
   190  
   191  In this mode files opened for read only are still read directly from
   192  the remote, write only and read/write files are buffered to disk
   193  first.
   194  
   195  This mode should support all normal file system operations.
   196  
   197  If an upload fails it will be retried at exponentially increasing
   198  intervals up to 1 minute.
   199  
   200  ### --vfs-cache-mode full
   201  
   202  In this mode all reads and writes are buffered to and from disk. When
   203  data is read from the remote this is buffered to disk as well.
   204  
   205  In this mode the files in the cache will be sparse files and rclone
   206  will keep track of which bits of the files it has downloaded.
   207  
   208  So if an application only reads the starts of each file, then rclone
   209  will only buffer the start of the file. These files will appear to be
   210  their full size in the cache, but they will be sparse files with only
   211  the data that has been downloaded present in them.
   212  
   213  This mode should support all normal file system operations and is
   214  otherwise identical to `--vfs-cache-mode` writes.
   215  
   216  When reading a file rclone will read `--buffer-size` plus
   217  `--vfs-read-ahead` bytes ahead.  The `--buffer-size` is buffered in memory
   218  whereas the `--vfs-read-ahead` is buffered on disk.
   219  
   220  When using this mode it is recommended that `--buffer-size` is not set
   221  too large and `--vfs-read-ahead` is set large if required.
   222  
   223  **IMPORTANT** not all file systems support sparse files. In particular
   224  FAT/exFAT do not. Rclone will perform very badly if the cache
   225  directory is on a filesystem which doesn't support sparse files and it
   226  will log an ERROR message if one is detected.
   227  
   228  ### Fingerprinting
   229  
   230  Various parts of the VFS use fingerprinting to see if a local file
   231  copy has changed relative to a remote file. Fingerprints are made
   232  from:
   233  
   234  - size
   235  - modification time
   236  - hash
   237  
   238  where available on an object.
   239  
   240  On some backends some of these attributes are slow to read (they take
   241  an extra API call per object, or extra work per object).
   242  
   243  For example `hash` is slow with the `local` and `sftp` backends as
   244  they have to read the entire file and hash it, and `modtime` is slow
   245  with the `s3`, `swift`, `ftp` and `qinqstor` backends because they
   246  need to do an extra API call to fetch it.
   247  
   248  If you use the `--vfs-fast-fingerprint` flag then rclone will not
   249  include the slow operations in the fingerprint. This makes the
   250  fingerprinting less accurate but much faster and will improve the
   251  opening time of cached files.
   252  
   253  If you are running a vfs cache over `local`, `s3` or `swift` backends
   254  then using this flag is recommended.
   255  
   256  Note that if you change the value of this flag, the fingerprints of
   257  the files in the cache may be invalidated and the files will need to
   258  be downloaded again.
   259  
   260  ## VFS Chunked Reading
   261  
   262  When rclone reads files from a remote it reads them in chunks. This
   263  means that rather than requesting the whole file rclone reads the
   264  chunk specified.  This can reduce the used download quota for some
   265  remotes by requesting only chunks from the remote that are actually
   266  read, at the cost of an increased number of requests.
   267  
   268  These flags control the chunking:
   269  
   270      --vfs-read-chunk-size SizeSuffix        Read the source objects in chunks (default 128M)
   271      --vfs-read-chunk-size-limit SizeSuffix  Max chunk doubling size (default off)
   272  
   273  Rclone will start reading a chunk of size `--vfs-read-chunk-size`,
   274  and then double the size for each read. When `--vfs-read-chunk-size-limit` is
   275  specified, and greater than `--vfs-read-chunk-size`, the chunk size for each
   276  open file will get doubled only until the specified value is reached. If the
   277  value is "off", which is the default, the limit is disabled and the chunk size
   278  will grow indefinitely.
   279  
   280  With `--vfs-read-chunk-size 100M` and `--vfs-read-chunk-size-limit 0`
   281  the following parts will be downloaded: 0-100M, 100M-200M, 200M-300M, 300M-400M and so on.
   282  When `--vfs-read-chunk-size-limit 500M` is specified, the result would be
   283  0-100M, 100M-300M, 300M-700M, 700M-1200M, 1200M-1700M and so on.
   284  
   285  Setting `--vfs-read-chunk-size` to `0` or "off" disables chunked reading.
   286  
   287  ## VFS Performance
   288  
   289  These flags may be used to enable/disable features of the VFS for
   290  performance or other reasons. See also the [chunked reading](#vfs-chunked-reading)
   291  feature.
   292  
   293  In particular S3 and Swift benefit hugely from the `--no-modtime` flag
   294  (or use `--use-server-modtime` for a slightly different effect) as each
   295  read of the modification time takes a transaction.
   296  
   297      --no-checksum     Don't compare checksums on up/download.
   298      --no-modtime      Don't read/write the modification time (can speed things up).
   299      --no-seek         Don't allow seeking in files.
   300      --read-only       Only allow read-only access.
   301  
   302  Sometimes rclone is delivered reads or writes out of order. Rather
   303  than seeking rclone will wait a short time for the in sequence read or
   304  write to come in. These flags only come into effect when not using an
   305  on disk cache file.
   306  
   307      --vfs-read-wait duration   Time to wait for in-sequence read before seeking (default 20ms)
   308      --vfs-write-wait duration  Time to wait for in-sequence write before giving error (default 1s)
   309  
   310  When using VFS write caching (`--vfs-cache-mode` with value writes or full),
   311  the global flag `--transfers` can be set to adjust the number of parallel uploads of
   312  modified files from the cache (the related global flag `--checkers` has no effect on the VFS).
   313  
   314      --transfers int  Number of file transfers to run in parallel (default 4)
   315  
   316  ## VFS Case Sensitivity
   317  
   318  Linux file systems are case-sensitive: two files can differ only
   319  by case, and the exact case must be used when opening a file.
   320  
   321  File systems in modern Windows are case-insensitive but case-preserving:
   322  although existing files can be opened using any case, the exact case used
   323  to create the file is preserved and available for programs to query.
   324  It is not allowed for two files in the same directory to differ only by case.
   325  
   326  Usually file systems on macOS are case-insensitive. It is possible to make macOS
   327  file systems case-sensitive but that is not the default.
   328  
   329  The `--vfs-case-insensitive` VFS flag controls how rclone handles these
   330  two cases. If its value is "false", rclone passes file names to the remote
   331  as-is. If the flag is "true" (or appears without a value on the
   332  command line), rclone may perform a "fixup" as explained below.
   333  
   334  The user may specify a file name to open/delete/rename/etc with a case
   335  different than what is stored on the remote. If an argument refers
   336  to an existing file with exactly the same name, then the case of the existing
   337  file on the disk will be used. However, if a file name with exactly the same
   338  name is not found but a name differing only by case exists, rclone will
   339  transparently fixup the name. This fixup happens only when an existing file
   340  is requested. Case sensitivity of file names created anew by rclone is
   341  controlled by the underlying remote.
   342  
   343  Note that case sensitivity of the operating system running rclone (the target)
   344  may differ from case sensitivity of a file system presented by rclone (the source).
   345  The flag controls whether "fixup" is performed to satisfy the target.
   346  
   347  If the flag is not provided on the command line, then its default value depends
   348  on the operating system where rclone runs: "true" on Windows and macOS, "false"
   349  otherwise. If the flag is provided without a value, then it is "true".
   350  
   351  The `--no-unicode-normalization` flag controls whether a similar "fixup" is
   352  performed for filenames that differ but are [canonically
   353  equivalent](https://en.wikipedia.org/wiki/Unicode_equivalence) with respect to
   354  unicode. Unicode normalization can be particularly helpful for users of macOS,
   355  which prefers form NFD instead of the NFC used by most other platforms. It is
   356  therefore highly recommended to keep the default of `false` on macOS, to avoid
   357  encoding compatibility issues.
   358  
   359  In the (probably unlikely) event that a directory has multiple duplicate
   360  filenames after applying case and unicode normalization, the `--vfs-block-norm-dupes`
   361  flag allows hiding these duplicates. This comes with a performance tradeoff, as
   362  rclone will have to scan the entire directory for duplicates when listing a
   363  directory. For this reason, it is recommended to leave this disabled if not
   364  needed. However, macOS users may wish to consider using it, as otherwise, if a
   365  remote directory contains both NFC and NFD versions of the same filename, an odd
   366  situation will occur: both versions of the file will be visible in the mount,
   367  and both will appear to be editable, however, editing either version will
   368  actually result in only the NFD version getting edited under the hood. `--vfs-block-
   369  norm-dupes` prevents this confusion by detecting this scenario, hiding the
   370  duplicates, and logging an error, similar to how this is handled in `rclone
   371  sync`.
   372  
   373  ## VFS Disk Options
   374  
   375  This flag allows you to manually set the statistics about the filing system.
   376  It can be useful when those statistics cannot be read correctly automatically.
   377  
   378      --vfs-disk-space-total-size    Manually set the total disk space size (example: 256G, default: -1)
   379  
   380  ## Alternate report of used bytes
   381  
   382  Some backends, most notably S3, do not report the amount of bytes used.
   383  If you need this information to be available when running `df` on the
   384  filesystem, then pass the flag `--vfs-used-is-size` to rclone.
   385  With this flag set, instead of relying on the backend to report this
   386  information, rclone will scan the whole remote similar to `rclone size`
   387  and compute the total used space itself.
   388  
   389  _WARNING._ Contrary to `rclone size`, this flag ignores filters so that the
   390  result is accurate. However, this is very inefficient and may cost lots of API
   391  calls resulting in extra charges. Use it as a last resort and only with caching.
   392  
   393  
   394  ```
   395  rclone serve dlna remote:path [flags]
   396  ```
   397  
   398  ## Options
   399  
   400  ```
   401        --addr string                            The ip:port or :port to bind the DLNA http server to (default ":7879")
   402        --announce-interval Duration             The interval between SSDP announcements (default 12m0s)
   403        --dir-cache-time Duration                Time to cache directory entries for (default 5m0s)
   404        --dir-perms FileMode                     Directory permissions (default 0777)
   405        --file-perms FileMode                    File permissions (default 0666)
   406        --gid uint32                             Override the gid field set by the filesystem (not supported on Windows) (default 1000)
   407    -h, --help                                   help for dlna
   408        --interface stringArray                  The interface to use for SSDP (repeat as necessary)
   409        --log-trace                              Enable trace logging of SOAP traffic
   410        --name string                            Name of DLNA server
   411        --no-checksum                            Don't compare checksums on up/download
   412        --no-modtime                             Don't read/write the modification time (can speed things up)
   413        --no-seek                                Don't allow seeking in files
   414        --poll-interval Duration                 Time to wait between polling for changes, must be smaller than dir-cache-time and only on supported remotes (set 0 to disable) (default 1m0s)
   415        --read-only                              Only allow read-only access
   416        --uid uint32                             Override the uid field set by the filesystem (not supported on Windows) (default 1000)
   417        --umask int                              Override the permission bits set by the filesystem (not supported on Windows) (default 2)
   418        --vfs-block-norm-dupes                   If duplicate filenames exist in the same directory (after normalization), log an error and hide the duplicates (may have a performance cost)
   419        --vfs-cache-max-age Duration             Max time since last access of objects in the cache (default 1h0m0s)
   420        --vfs-cache-max-size SizeSuffix          Max total size of objects in the cache (default off)
   421        --vfs-cache-min-free-space SizeSuffix    Target minimum free space on the disk containing the cache (default off)
   422        --vfs-cache-mode CacheMode               Cache mode off|minimal|writes|full (default off)
   423        --vfs-cache-poll-interval Duration       Interval to poll the cache for stale objects (default 1m0s)
   424        --vfs-case-insensitive                   If a file name not found, find a case insensitive match
   425        --vfs-disk-space-total-size SizeSuffix   Specify the total space of disk (default off)
   426        --vfs-fast-fingerprint                   Use fast (less accurate) fingerprints for change detection
   427        --vfs-read-ahead SizeSuffix              Extra read ahead over --buffer-size when using cache-mode full
   428        --vfs-read-chunk-size SizeSuffix         Read the source objects in chunks (default 128Mi)
   429        --vfs-read-chunk-size-limit SizeSuffix   If greater than --vfs-read-chunk-size, double the chunk size after each chunk read, until the limit is reached ('off' is unlimited) (default off)
   430        --vfs-read-wait Duration                 Time to wait for in-sequence read before seeking (default 20ms)
   431        --vfs-refresh                            Refreshes the directory cache recursively in the background on start
   432        --vfs-used-is-size rclone size           Use the rclone size algorithm for Used size
   433        --vfs-write-back Duration                Time to writeback files after last use when using cache (default 5s)
   434        --vfs-write-wait Duration                Time to wait for in-sequence write before giving error (default 1s)
   435  ```
   436  
   437  
   438  ## Filter Options
   439  
   440  Flags for filtering directory listings.
   441  
   442  ```
   443        --delete-excluded                     Delete files on dest excluded from sync
   444        --exclude stringArray                 Exclude files matching pattern
   445        --exclude-from stringArray            Read file exclude patterns from file (use - to read from stdin)
   446        --exclude-if-present stringArray      Exclude directories if filename is present
   447        --files-from stringArray              Read list of source-file names from file (use - to read from stdin)
   448        --files-from-raw stringArray          Read list of source-file names from file without any processing of lines (use - to read from stdin)
   449    -f, --filter stringArray                  Add a file filtering rule
   450        --filter-from stringArray             Read file filtering patterns from a file (use - to read from stdin)
   451        --ignore-case                         Ignore case in filters (case insensitive)
   452        --include stringArray                 Include files matching pattern
   453        --include-from stringArray            Read file include patterns from file (use - to read from stdin)
   454        --max-age Duration                    Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off)
   455        --max-depth int                       If set limits the recursion depth to this (default -1)
   456        --max-size SizeSuffix                 Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off)
   457        --metadata-exclude stringArray        Exclude metadatas matching pattern
   458        --metadata-exclude-from stringArray   Read metadata exclude patterns from file (use - to read from stdin)
   459        --metadata-filter stringArray         Add a metadata filtering rule
   460        --metadata-filter-from stringArray    Read metadata filtering patterns from a file (use - to read from stdin)
   461        --metadata-include stringArray        Include metadatas matching pattern
   462        --metadata-include-from stringArray   Read metadata include patterns from file (use - to read from stdin)
   463        --min-age Duration                    Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off)
   464        --min-size SizeSuffix                 Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off)
   465  ```
   466  
   467  See the [global flags page](/flags/) for global options not listed here.
   468  
   469  # SEE ALSO
   470  
   471  * [rclone serve](/commands/rclone_serve/)	 - Serve a remote over a protocol.
   472