github.com/xhghs/rclone@v1.51.1-0.20200430155106-e186a28cced8/docs/content/docs.md (about) 1 --- 2 title: "Documentation" 3 description: "Rclone Usage" 4 date: "2019-02-25" 5 --- 6 7 Configure 8 --------- 9 10 First, you'll need to configure rclone. As the object storage systems 11 have quite complicated authentication these are kept in a config file. 12 (See the `--config` entry for how to find the config file and choose 13 its location.) 14 15 The easiest way to make the config is to run rclone with the config 16 option: 17 18 rclone config 19 20 See the following for detailed instructions for 21 22 * [1Fichier](/fichier/) 23 * [Alias](/alias/) 24 * [Amazon Drive](/amazonclouddrive/) 25 * [Amazon S3](/s3/) 26 * [Backblaze B2](/b2/) 27 * [Box](/box/) 28 * [Cache](/cache/) 29 * [Chunker](/chunker/) - transparently splits large files for other remotes 30 * [Citrix ShareFile](/sharefile/) 31 * [Crypt](/crypt/) - to encrypt other remotes 32 * [DigitalOcean Spaces](/s3/#digitalocean-spaces) 33 * [Dropbox](/dropbox/) 34 * [FTP](/ftp/) 35 * [Google Cloud Storage](/googlecloudstorage/) 36 * [Google Drive](/drive/) 37 * [Google Photos](/googlephotos/) 38 * [HTTP](/http/) 39 * [Hubic](/hubic/) 40 * [Jottacloud / GetSky.no](/jottacloud/) 41 * [Koofr](/koofr/) 42 * [Mail.ru Cloud](/mailru/) 43 * [Mega](/mega/) 44 * [Memory](/memory/) 45 * [Microsoft Azure Blob Storage](/azureblob/) 46 * [Microsoft OneDrive](/onedrive/) 47 * [Openstack Swift / Rackspace Cloudfiles / Memset Memstore](/swift/) 48 * [OpenDrive](/opendrive/) 49 * [Pcloud](/pcloud/) 50 * [premiumize.me](/premiumizeme/) 51 * [put.io](/putio/) 52 * [QingStor](/qingstor/) 53 * [SFTP](/sftp/) 54 * [SugarSync](/sugarsync/) 55 * [Union](/union/) 56 * [WebDAV](/webdav/) 57 * [Yandex Disk](/yandex/) 58 * [The local filesystem](/local/) 59 60 Usage 61 ----- 62 63 Rclone syncs a directory tree from one storage system to another. 64 65 Its syntax is like this 66 67 Syntax: [options] subcommand <parameters> <parameters...> 68 69 Source and destination paths are specified by the name you gave the 70 storage system in the config file then the sub path, eg 71 "drive:myfolder" to look at "myfolder" in Google drive. 72 73 You can define as many storage paths as you like in the config file. 74 75 Subcommands 76 ----------- 77 78 rclone uses a system of subcommands. For example 79 80 rclone ls remote:path # lists a remote 81 rclone copy /local/path remote:path # copies /local/path to the remote 82 rclone sync /local/path remote:path # syncs /local/path to the remote 83 84 The main rclone commands with most used first 85 86 * [rclone config](/commands/rclone_config/) - Enter an interactive configuration session. 87 * [rclone copy](/commands/rclone_copy/) - Copy files from source to dest, skipping already copied. 88 * [rclone sync](/commands/rclone_sync/) - Make source and dest identical, modifying destination only. 89 * [rclone move](/commands/rclone_move/) - Move files from source to dest. 90 * [rclone delete](/commands/rclone_delete/) - Remove the contents of path. 91 * [rclone purge](/commands/rclone_purge/) - Remove the path and all of its contents. 92 * [rclone mkdir](/commands/rclone_mkdir/) - Make the path if it doesn't already exist. 93 * [rclone rmdir](/commands/rclone_rmdir/) - Remove the path. 94 * [rclone rmdirs](/commands/rclone_rmdirs/) - Remove any empty directories under the path. 95 * [rclone check](/commands/rclone_check/) - Check if the files in the source and destination match. 96 * [rclone ls](/commands/rclone_ls/) - List all the objects in the path with size and path. 97 * [rclone lsd](/commands/rclone_lsd/) - List all directories/containers/buckets in the path. 98 * [rclone lsl](/commands/rclone_lsl/) - List all the objects in the path with size, modification time and path. 99 * [rclone md5sum](/commands/rclone_md5sum/) - Produce an md5sum file for all the objects in the path. 100 * [rclone sha1sum](/commands/rclone_sha1sum/) - Produce a sha1sum file for all the objects in the path. 101 * [rclone size](/commands/rclone_size/) - Return the total size and number of objects in remote:path. 102 * [rclone version](/commands/rclone_version/) - Show the version number. 103 * [rclone cleanup](/commands/rclone_cleanup/) - Clean up the remote if possible. 104 * [rclone dedupe](/commands/rclone_dedupe/) - Interactively find duplicate files and delete/rename them. 105 * [rclone authorize](/commands/rclone_authorize/) - Remote authorization. 106 * [rclone cat](/commands/rclone_cat/) - Concatenate any files and send them to stdout. 107 * [rclone copyto](/commands/rclone_copyto/) - Copy files from source to dest, skipping already copied. 108 * [rclone genautocomplete](/commands/rclone_genautocomplete/) - Output shell completion scripts for rclone. 109 * [rclone gendocs](/commands/rclone_gendocs/) - Output markdown docs for rclone to the directory supplied. 110 * [rclone listremotes](/commands/rclone_listremotes/) - List all the remotes in the config file. 111 * [rclone mount](/commands/rclone_mount/) - Mount the remote as a mountpoint. 112 * [rclone moveto](/commands/rclone_moveto/) - Move file or directory from source to dest. 113 * [rclone obscure](/commands/rclone_obscure/) - Obscure password for use in the rclone.conf 114 * [rclone cryptcheck](/commands/rclone_cryptcheck/) - Check the integrity of a crypted remote. 115 * [rclone about](/commands/rclone_about/) - Get quota information from the remote. 116 117 See the [commands index](/commands/) for the full list. 118 119 Copying single files 120 -------------------- 121 122 rclone normally syncs or copies directories. However, if the source 123 remote points to a file, rclone will just copy that file. The 124 destination remote must point to a directory - rclone will give the 125 error `Failed to create file system for "remote:file": is a file not a 126 directory` if it isn't. 127 128 For example, suppose you have a remote with a file in called 129 `test.jpg`, then you could copy just that file like this 130 131 rclone copy remote:test.jpg /tmp/download 132 133 The file `test.jpg` will be placed inside `/tmp/download`. 134 135 This is equivalent to specifying 136 137 rclone copy --files-from /tmp/files remote: /tmp/download 138 139 Where `/tmp/files` contains the single line 140 141 test.jpg 142 143 It is recommended to use `copy` when copying individual files, not `sync`. 144 They have pretty much the same effect but `copy` will use a lot less 145 memory. 146 147 Syntax of remote paths 148 ---------------------- 149 150 The syntax of the paths passed to the rclone command are as follows. 151 152 ### /path/to/dir 153 154 This refers to the local file system. 155 156 On Windows only `\` may be used instead of `/` in local paths 157 **only**, non local paths must use `/`. 158 159 These paths needn't start with a leading `/` - if they don't then they 160 will be relative to the current directory. 161 162 ### remote:path/to/dir 163 164 This refers to a directory `path/to/dir` on `remote:` as defined in 165 the config file (configured with `rclone config`). 166 167 ### remote:/path/to/dir 168 169 On most backends this is refers to the same directory as 170 `remote:path/to/dir` and that format should be preferred. On a very 171 small number of remotes (FTP, SFTP, Dropbox for business) this will 172 refer to a different directory. On these, paths without a leading `/` 173 will refer to your "home" directory and paths with a leading `/` will 174 refer to the root. 175 176 ### :backend:path/to/dir 177 178 This is an advanced form for creating remotes on the fly. `backend` 179 should be the name or prefix of a backend (the `type` in the config 180 file) and all the configuration for the backend should be provided on 181 the command line (or in environment variables). 182 183 Here are some examples: 184 185 rclone lsd --http-url https://pub.rclone.org :http: 186 187 To list all the directories in the root of `https://pub.rclone.org/`. 188 189 rclone lsf --http-url https://example.com :http:path/to/dir 190 191 To list files and directories in `https://example.com/path/to/dir/` 192 193 rclone copy --http-url https://example.com :http:path/to/dir /tmp/dir 194 195 To copy files and directories in `https://example.com/path/to/dir` to `/tmp/dir`. 196 197 rclone copy --sftp-host example.com :sftp:path/to/dir /tmp/dir 198 199 To copy files and directories from `example.com` in the relative 200 directory `path/to/dir` to `/tmp/dir` using sftp. 201 202 Quoting and the shell 203 --------------------- 204 205 When you are typing commands to your computer you are using something 206 called the command line shell. This interprets various characters in 207 an OS specific way. 208 209 Here are some gotchas which may help users unfamiliar with the shell rules 210 211 ### Linux / OSX ### 212 213 If your names have spaces or shell metacharacters (eg `*`, `?`, `$`, 214 `'`, `"` etc) then you must quote them. Use single quotes `'` by default. 215 216 rclone copy 'Important files?' remote:backup 217 218 If you want to send a `'` you will need to use `"`, eg 219 220 rclone copy "O'Reilly Reviews" remote:backup 221 222 The rules for quoting metacharacters are complicated and if you want 223 the full details you'll have to consult the manual page for your 224 shell. 225 226 ### Windows ### 227 228 If your names have spaces in you need to put them in `"`, eg 229 230 rclone copy "E:\folder name\folder name\folder name" remote:backup 231 232 If you are using the root directory on its own then don't quote it 233 (see [#464](https://github.com/rclone/rclone/issues/464) for why), eg 234 235 rclone copy E:\ remote:backup 236 237 Copying files or directories with `:` in the names 238 -------------------------------------------------- 239 240 rclone uses `:` to mark a remote name. This is, however, a valid 241 filename component in non-Windows OSes. The remote name parser will 242 only search for a `:` up to the first `/` so if you need to act on a 243 file or directory like this then use the full path starting with a 244 `/`, or use `./` as a current directory prefix. 245 246 So to sync a directory called `sync:me` to a remote called `remote:` use 247 248 rclone sync ./sync:me remote:path 249 250 or 251 252 rclone sync /full/path/to/sync:me remote:path 253 254 Server Side Copy 255 ---------------- 256 257 Most remotes (but not all - see [the 258 overview](/overview/#optional-features)) support server side copy. 259 260 This means if you want to copy one folder to another then rclone won't 261 download all the files and re-upload them; it will instruct the server 262 to copy them in place. 263 264 Eg 265 266 rclone copy s3:oldbucket s3:newbucket 267 268 Will copy the contents of `oldbucket` to `newbucket` without 269 downloading and re-uploading. 270 271 Remotes which don't support server side copy **will** download and 272 re-upload in this case. 273 274 Server side copies are used with `sync` and `copy` and will be 275 identified in the log when using the `-v` flag. The `move` command 276 may also use them if remote doesn't support server side move directly. 277 This is done by issuing a server side copy then a delete which is much 278 quicker than a download and re-upload. 279 280 Server side copies will only be attempted if the remote names are the 281 same. 282 283 This can be used when scripting to make aged backups efficiently, eg 284 285 rclone sync remote:current-backup remote:previous-backup 286 rclone sync /path/to/files remote:current-backup 287 288 Options 289 ------- 290 291 Rclone has a number of options to control its behaviour. 292 293 Options that take parameters can have the values passed in two ways, 294 `--option=value` or `--option value`. However boolean (true/false) 295 options behave slightly differently to the other options in that 296 `--boolean` sets the option to `true` and the absence of the flag sets 297 it to `false`. It is also possible to specify `--boolean=false` or 298 `--boolean=true`. Note that `--boolean false` is not valid - this is 299 parsed as `--boolean` and the `false` is parsed as an extra command 300 line argument for rclone. 301 302 Options which use TIME use the go time parser. A duration string is a 303 possibly signed sequence of decimal numbers, each with optional 304 fraction and a unit suffix, such as "300ms", "-1.5h" or "2h45m". Valid 305 time units are "ns", "us" (or "µs"), "ms", "s", "m", "h". 306 307 Options which use SIZE use kByte by default. However, a suffix of `b` 308 for bytes, `k` for kBytes, `M` for MBytes, `G` for GBytes, `T` for 309 TBytes and `P` for PBytes may be used. These are the binary units, eg 310 1, 2\*\*10, 2\*\*20, 2\*\*30 respectively. 311 312 ### --backup-dir=DIR ### 313 314 When using `sync`, `copy` or `move` any files which would have been 315 overwritten or deleted are moved in their original hierarchy into this 316 directory. 317 318 If `--suffix` is set, then the moved files will have the suffix added 319 to them. If there is a file with the same path (after the suffix has 320 been added) in DIR, then it will be overwritten. 321 322 The remote in use must support server side move or copy and you must 323 use the same remote as the destination of the sync. The backup 324 directory must not overlap the destination directory. 325 326 For example 327 328 rclone sync /path/to/local remote:current --backup-dir remote:old 329 330 will sync `/path/to/local` to `remote:current`, but for any files 331 which would have been updated or deleted will be stored in 332 `remote:old`. 333 334 If running rclone from a script you might want to use today's date as 335 the directory name passed to `--backup-dir` to store the old files, or 336 you might want to pass `--suffix` with today's date. 337 338 See `--compare-dest` and `--copy-dest`. 339 340 ### --bind string ### 341 342 Local address to bind to for outgoing connections. This can be an 343 IPv4 address (1.2.3.4), an IPv6 address (1234::789A) or host name. If 344 the host name doesn't resolve or resolves to more than one IP address 345 it will give an error. 346 347 ### --bwlimit=BANDWIDTH_SPEC ### 348 349 This option controls the bandwidth limit. Limits can be specified 350 in two ways: As a single limit, or as a timetable. 351 352 Single limits last for the duration of the session. To use a single limit, 353 specify the desired bandwidth in kBytes/s, or use a suffix b|k|M|G. The 354 default is `0` which means to not limit bandwidth. 355 356 For example, to limit bandwidth usage to 10 MBytes/s use `--bwlimit 10M` 357 358 It is also possible to specify a "timetable" of limits, which will cause 359 certain limits to be applied at certain times. To specify a timetable, format your 360 entries as "WEEKDAY-HH:MM,BANDWIDTH WEEKDAY-HH:MM,BANDWIDTH..." where: 361 WEEKDAY is optional element. 362 It could be written as whole world or only using 3 first characters. 363 HH:MM is an hour from 00:00 to 23:59. 364 365 An example of a typical timetable to avoid link saturation during daytime 366 working hours could be: 367 368 `--bwlimit "08:00,512 12:00,10M 13:00,512 18:00,30M 23:00,off"` 369 370 In this example, the transfer bandwidth will be every day set to 512kBytes/sec at 8am. 371 At noon, it will raise to 10Mbytes/s, and drop back to 512kBytes/sec at 1pm. 372 At 6pm, the bandwidth limit will be set to 30MBytes/s, and at 11pm it will be 373 completely disabled (full speed). Anything between 11pm and 8am will remain 374 unlimited. 375 376 An example of timetable with WEEKDAY could be: 377 378 `--bwlimit "Mon-00:00,512 Fri-23:59,10M Sat-10:00,1M Sun-20:00,off"` 379 380 It mean that, the transfer bandwidth will be set to 512kBytes/sec on Monday. 381 It will raise to 10Mbytes/s before the end of Friday. 382 At 10:00 on Sunday it will be set to 1Mbyte/s. 383 From 20:00 at Sunday will be unlimited. 384 385 Timeslots without weekday are extended to whole week. 386 So this one example: 387 388 `--bwlimit "Mon-00:00,512 12:00,1M Sun-20:00,off"` 389 390 Is equal to this: 391 392 `--bwlimit "Mon-00:00,512Mon-12:00,1M Tue-12:00,1M Wed-12:00,1M Thu-12:00,1M Fri-12:00,1M Sat-12:00,1M Sun-12:00,1M Sun-20:00,off"` 393 394 Bandwidth limits only apply to the data transfer. They don't apply to the 395 bandwidth of the directory listings etc. 396 397 Note that the units are Bytes/s, not Bits/s. Typically connections are 398 measured in Bits/s - to convert divide by 8. For example, let's say 399 you have a 10 Mbit/s connection and you wish rclone to use half of it 400 - 5 Mbit/s. This is 5/8 = 0.625MByte/s so you would use a `--bwlimit 401 0.625M` parameter for rclone. 402 403 On Unix systems (Linux, MacOS, …) the bandwidth limiter can be toggled by 404 sending a `SIGUSR2` signal to rclone. This allows to remove the limitations 405 of a long running rclone transfer and to restore it back to the value specified 406 with `--bwlimit` quickly when needed. Assuming there is only one rclone instance 407 running, you can toggle the limiter like this: 408 409 kill -SIGUSR2 $(pidof rclone) 410 411 If you configure rclone with a [remote control](/rc) then you can use 412 change the bwlimit dynamically: 413 414 rclone rc core/bwlimit rate=1M 415 416 ### --buffer-size=SIZE ### 417 418 Use this sized buffer to speed up file transfers. Each `--transfer` 419 will use this much memory for buffering. 420 421 When using `mount` or `cmount` each open file descriptor will use this much 422 memory for buffering. 423 See the [mount](/commands/rclone_mount/#file-buffering) documentation for more details. 424 425 Set to 0 to disable the buffering for the minimum memory usage. 426 427 Note that the memory allocation of the buffers is influenced by the 428 [--use-mmap](#use-mmap) flag. 429 430 ### --checkers=N ### 431 432 The number of checkers to run in parallel. Checkers do the equality 433 checking of files during a sync. For some storage systems (eg S3, 434 Swift, Dropbox) this can take a significant amount of time so they are 435 run in parallel. 436 437 The default is to run 8 checkers in parallel. 438 439 ### -c, --checksum ### 440 441 Normally rclone will look at modification time and size of files to 442 see if they are equal. If you set this flag then rclone will check 443 the file hash and size to determine if files are equal. 444 445 This is useful when the remote doesn't support setting modified time 446 and a more accurate sync is desired than just checking the file size. 447 448 This is very useful when transferring between remotes which store the 449 same hash type on the object, eg Drive and Swift. For details of which 450 remotes support which hash type see the table in the [overview 451 section](/overview/). 452 453 Eg `rclone --checksum sync s3:/bucket swift:/bucket` would run much 454 quicker than without the `--checksum` flag. 455 456 When using this flag, rclone won't update mtimes of remote files if 457 they are incorrect as it would normally. 458 459 ### --compare-dest=DIR ### 460 461 When using `sync`, `copy` or `move` DIR is checked in addition to the 462 destination for files. If a file identical to the source is found that 463 file is NOT copied from source. This is useful to copy just files that 464 have changed since the last backup. 465 466 You must use the same remote as the destination of the sync. The 467 compare directory must not overlap the destination directory. 468 469 See `--copy-dest` and `--backup-dir`. 470 471 ### --config=CONFIG_FILE ### 472 473 Specify the location of the rclone config file. 474 475 Normally the config file is in your home directory as a file called 476 `.config/rclone/rclone.conf` (or `.rclone.conf` if created with an 477 older version). If `$XDG_CONFIG_HOME` is set it will be at 478 `$XDG_CONFIG_HOME/rclone/rclone.conf`. 479 480 If there is a file `rclone.conf` in the same directory as the rclone 481 executable it will be preferred. This file must be created manually 482 for Rclone to use it, it will never be created automatically. 483 484 If you run `rclone config file` you will see where the default 485 location is for you. 486 487 Use this flag to override the config location, eg `rclone 488 --config=".myconfig" .config`. 489 490 ### --contimeout=TIME ### 491 492 Set the connection timeout. This should be in go time format which 493 looks like `5s` for 5 seconds, `10m` for 10 minutes, or `3h30m`. 494 495 The connection timeout is the amount of time rclone will wait for a 496 connection to go through to a remote object storage system. It is 497 `1m` by default. 498 499 ### --copy-dest=DIR ### 500 501 When using `sync`, `copy` or `move` DIR is checked in addition to the 502 destination for files. If a file identical to the source is found that 503 file is server side copied from DIR to the destination. This is useful 504 for incremental backup. 505 506 The remote in use must support server side copy and you must 507 use the same remote as the destination of the sync. The compare 508 directory must not overlap the destination directory. 509 510 See `--compare-dest` and `--backup-dir`. 511 512 ### --dedupe-mode MODE ### 513 514 Mode to run dedupe command in. One of `interactive`, `skip`, `first`, `newest`, `oldest`, `rename`. The default is `interactive`. See the dedupe command for more information as to what these options mean. 515 516 ### --disable FEATURE,FEATURE,... ### 517 518 This disables a comma separated list of optional features. For example 519 to disable server side move and server side copy use: 520 521 --disable move,copy 522 523 The features can be put in in any case. 524 525 To see a list of which features can be disabled use: 526 527 --disable help 528 529 See the overview [features](/overview/#features) and 530 [optional features](/overview/#optional-features) to get an idea of 531 which feature does what. 532 533 This flag can be useful for debugging and in exceptional circumstances 534 (eg Google Drive limiting the total volume of Server Side Copies to 535 100GB/day). 536 537 ### -n, --dry-run ### 538 539 Do a trial run with no permanent changes. Use this to see what rclone 540 would do without actually doing it. Useful when setting up the `sync` 541 command which deletes files in the destination. 542 543 ### --expect-continue-timeout=TIME ### 544 545 This specifies the amount of time to wait for a server's first 546 response headers after fully writing the request headers if the 547 request has an "Expect: 100-continue" header. Not all backends support 548 using this. 549 550 Zero means no timeout and causes the body to be sent immediately, 551 without waiting for the server to approve. This time does not include 552 the time to send the request header. 553 554 The default is `1s`. Set to 0 to disable. 555 556 ### --ignore-case-sync ### 557 558 Using this option will cause rclone to ignore the case of the files 559 when synchronizing so files will not be copied/synced when the 560 existing filenames are the same, even if the casing is different. 561 562 ### --ignore-checksum ### 563 564 Normally rclone will check that the checksums of transferred files 565 match, and give an error "corrupted on transfer" if they don't. 566 567 You can use this option to skip that check. You should only use it if 568 you have had the "corrupted on transfer" error message and you are 569 sure you might want to transfer potentially corrupted data. 570 571 ### --ignore-existing ### 572 573 Using this option will make rclone unconditionally skip all files 574 that exist on the destination, no matter the content of these files. 575 576 While this isn't a generally recommended option, it can be useful 577 in cases where your files change due to encryption. However, it cannot 578 correct partial transfers in case a transfer was interrupted. 579 580 ### --ignore-size ### 581 582 Normally rclone will look at modification time and size of files to 583 see if they are equal. If you set this flag then rclone will check 584 only the modification time. If `--checksum` is set then it only 585 checks the checksum. 586 587 It will also cause rclone to skip verifying the sizes are the same 588 after transfer. 589 590 This can be useful for transferring files to and from OneDrive which 591 occasionally misreports the size of image files (see 592 [#399](https://github.com/rclone/rclone/issues/399) for more info). 593 594 ### -I, --ignore-times ### 595 596 Using this option will cause rclone to unconditionally upload all 597 files regardless of the state of files on the destination. 598 599 Normally rclone would skip any files that have the same 600 modification time and are the same size (or have the same checksum if 601 using `--checksum`). 602 603 ### --immutable ### 604 605 Treat source and destination files as immutable and disallow 606 modification. 607 608 With this option set, files will be created and deleted as requested, 609 but existing files will never be updated. If an existing file does 610 not match between the source and destination, rclone will give the error 611 `Source and destination exist but do not match: immutable file modified`. 612 613 Note that only commands which transfer files (e.g. `sync`, `copy`, 614 `move`) are affected by this behavior, and only modification is 615 disallowed. Files may still be deleted explicitly (e.g. `delete`, 616 `purge`) or implicitly (e.g. `sync`, `move`). Use `copy --immutable` 617 if it is desired to avoid deletion as well as modification. 618 619 This can be useful as an additional layer of protection for immutable 620 or append-only data sets (notably backup archives), where modification 621 implies corruption and should not be propagated. 622 623 ## --leave-root ### 624 625 During rmdirs it will not remove root directory, even if it's empty. 626 627 ### --log-file=FILE ### 628 629 Log all of rclone's output to FILE. This is not active by default. 630 This can be useful for tracking down problems with syncs in 631 combination with the `-v` flag. See the [Logging section](#logging) 632 for more info. 633 634 Note that if you are using the `logrotate` program to manage rclone's 635 logs, then you should use the `copytruncate` option as rclone doesn't 636 have a signal to rotate logs. 637 638 ### --log-format LIST ### 639 640 Comma separated list of log format options. `date`, `time`, `microseconds`, `longfile`, `shortfile`, `UTC`. The default is "`date`,`time`". 641 642 ### --log-level LEVEL ### 643 644 This sets the log level for rclone. The default log level is `NOTICE`. 645 646 `DEBUG` is equivalent to `-vv`. It outputs lots of debug info - useful 647 for bug reports and really finding out what rclone is doing. 648 649 `INFO` is equivalent to `-v`. It outputs information about each transfer 650 and prints stats once a minute by default. 651 652 `NOTICE` is the default log level if no logging flags are supplied. It 653 outputs very little when things are working normally. It outputs 654 warnings and significant events. 655 656 `ERROR` is equivalent to `-q`. It only outputs error messages. 657 658 ### --use-json-log ### 659 660 This switches the log format to JSON for rclone. The fields of json log 661 are level, msg, source, time. 662 663 ### --low-level-retries NUMBER ### 664 665 This controls the number of low level retries rclone does. 666 667 A low level retry is used to retry a failing operation - typically one 668 HTTP request. This might be uploading a chunk of a big file for 669 example. You will see low level retries in the log with the `-v` 670 flag. 671 672 This shouldn't need to be changed from the default in normal operations. 673 However, if you get a lot of low level retries you may wish 674 to reduce the value so rclone moves on to a high level retry (see the 675 `--retries` flag) quicker. 676 677 Disable low level retries with `--low-level-retries 1`. 678 679 ### --max-backlog=N ### 680 681 This is the maximum allowable backlog of files in a sync/copy/move 682 queued for being checked or transferred. 683 684 This can be set arbitrarily large. It will only use memory when the 685 queue is in use. Note that it will use in the order of N kB of memory 686 when the backlog is in use. 687 688 Setting this large allows rclone to calculate how many files are 689 pending more accurately, give a more accurate estimated finish 690 time and make `--order-by` work more accurately. 691 692 Setting this small will make rclone more synchronous to the listings 693 of the remote which may be desirable. 694 695 ### --max-delete=N ### 696 697 This tells rclone not to delete more than N files. If that limit is 698 exceeded then a fatal error will be generated and rclone will stop the 699 operation in progress. 700 701 ### --max-depth=N ### 702 703 This modifies the recursion depth for all the commands except purge. 704 705 So if you do `rclone --max-depth 1 ls remote:path` you will see only 706 the files in the top level directory. Using `--max-depth 2` means you 707 will see all the files in first two directory levels and so on. 708 709 For historical reasons the `lsd` command defaults to using a 710 `--max-depth` of 1 - you can override this with the command line flag. 711 712 You can use this command to disable recursion (with `--max-depth 1`). 713 714 Note that if you use this with `sync` and `--delete-excluded` the 715 files not recursed through are considered excluded and will be deleted 716 on the destination. Test first with `--dry-run` if you are not sure 717 what will happen. 718 719 ### --max-duration=TIME ### 720 721 Rclone will stop scheduling new transfers when it has run for the 722 duration specified. 723 724 Defaults to off. 725 726 When the limit is reached any existing transfers will complete. 727 728 Rclone won't exit with an error if the transfer limit is reached. 729 730 ### --max-transfer=SIZE ### 731 732 Rclone will stop transferring when it has reached the size specified. 733 Defaults to off. 734 735 When the limit is reached all transfers will stop immediately. 736 737 Rclone will exit with exit code 8 if the transfer limit is reached. 738 739 ### --modify-window=TIME ### 740 741 When checking whether a file has been modified, this is the maximum 742 allowed time difference that a file can have and still be considered 743 equivalent. 744 745 The default is `1ns` unless this is overridden by a remote. For 746 example OS X only stores modification times to the nearest second so 747 if you are reading and writing to an OS X filing system this will be 748 `1s` by default. 749 750 This command line flag allows you to override that computed default. 751 752 ### --multi-thread-cutoff=SIZE ### 753 754 When downloading files to the local backend above this size, rclone 755 will use multiple threads to download the file. (default 250M) 756 757 Rclone preallocates the file (using `fallocate(FALLOC_FL_KEEP_SIZE)` 758 on unix or `NTSetInformationFile` on Windows both of which takes no 759 time) then each thread writes directly into the file at the correct 760 place. This means that rclone won't create fragmented or sparse files 761 and there won't be any assembly time at the end of the transfer. 762 763 The number of threads used to dowload is controlled by 764 `--multi-thread-streams`. 765 766 Use `-vv` if you wish to see info about the threads. 767 768 This will work with the `sync`/`copy`/`move` commands and friends 769 `copyto`/`moveto`. Multi thread downloads will be used with `rclone 770 mount` and `rclone serve` if `--vfs-cache-mode` is set to `writes` or 771 above. 772 773 **NB** that this **only** works for a local destination but will work 774 with any source. 775 776 **NB** that multi thread copies are disabled for local to local copies 777 as they are faster without unless `--multi-thread-streams` is set 778 explicitly. 779 780 ### --multi-thread-streams=N ### 781 782 When using multi thread downloads (see above `--multi-thread-cutoff`) 783 this sets the maximum number of streams to use. Set to `0` to disable 784 multi thread downloads. (Default 4) 785 786 Exactly how many streams rclone uses for the download depends on the 787 size of the file. To calculate the number of download streams Rclone 788 divides the size of the file by the `--multi-thread-cutoff` and rounds 789 up, up to the maximum set with `--multi-thread-streams`. 790 791 So if `--multi-thread-cutoff 250MB` and `--multi-thread-streams 4` are 792 in effect (the defaults): 793 794 - 0MB.250MB files will be downloaded with 1 stream 795 - 250MB..500MB files will be downloaded with 2 streams 796 - 500MB..750MB files will be downloaded with 3 streams 797 - 750MB+ files will be downloaded with 4 streams 798 799 ### --no-check-dest ### 800 801 The `--no-check-dest` can be used with `move` or `copy` and it causes 802 rclone not to check the destination at all when copying files. 803 804 This means that: 805 806 - the destination is not listed minimising the API calls 807 - files are always transferred 808 - this can cause duplicates on remotes which allow it (eg Google Drive) 809 - `--retries 1` is recommended otherwise you'll transfer everything again on a retry 810 811 This flag is useful to minimise the transactions if you know that none 812 of the files are on the destination. 813 814 This is a specialized flag which should be ignored by most users! 815 816 ### --no-gzip-encoding ### 817 818 Don't set `Accept-Encoding: gzip`. This means that rclone won't ask 819 the server for compressed files automatically. Useful if you've set 820 the server to return files with `Content-Encoding: gzip` but you 821 uploaded compressed files. 822 823 There is no need to set this in normal operation, and doing so will 824 decrease the network transfer efficiency of rclone. 825 826 ### --no-traverse ### 827 828 The `--no-traverse` flag controls whether the destination file system 829 is traversed when using the `copy` or `move` commands. 830 `--no-traverse` is not compatible with `sync` and will be ignored if 831 you supply it with `sync`. 832 833 If you are only copying a small number of files (or are filtering most 834 of the files) and/or have a large number of files on the destination 835 then `--no-traverse` will stop rclone listing the destination and save 836 time. 837 838 However, if you are copying a large number of files, especially if you 839 are doing a copy where lots of the files under consideration haven't 840 changed and won't need copying then you shouldn't use `--no-traverse`. 841 842 See [rclone copy](/commands/rclone_copy/) for an example of how to use it. 843 844 ### --no-update-modtime ### 845 846 When using this flag, rclone won't update modification times of remote 847 files if they are incorrect as it would normally. 848 849 This can be used if the remote is being synced with another tool also 850 (eg the Google Drive client). 851 852 ### --order-by string ### 853 854 The `--order-by` flag controls the order in which files in the backlog 855 are processed in `rclone sync`, `rclone copy` and `rclone move`. 856 857 The order by string is constructed like this. The first part 858 describes what aspect is being measured: 859 860 - `size` - order by the size of the files 861 - `name` - order by the full path of the files 862 - `modtime` - order by the modification date of the files 863 864 This can have a modifier appended with a comma: 865 866 - `ascending` or `asc` - order so that the smallest (or oldest) is processed first 867 - `descending` or `desc` - order so that the largest (or newest) is processed first 868 869 If no modifier is supplied then the order is `ascending`. 870 871 For example 872 873 - `--order-by size,desc` - send the largest files first 874 - `--order-by modtime,ascending` - send the oldest files first 875 - `--order-by name` - send the files with alphabetically by path first 876 877 If the `--order-by` flag is not supplied or it is supplied with an 878 empty string then the default ordering will be used which is as 879 scanned. With `--checkers 1` this is mostly alphabetical, however 880 with the default `--checkers 8` it is somewhat random. 881 882 #### Limitations 883 884 The `--order-by` flag does not do a separate pass over the data. This 885 means that it may transfer some files out of the order specified if 886 887 - there are no files in the backlog or the source has not been fully scanned yet 888 - there are more than [--max-backlog](#max-backlog-n) files in the backlog 889 890 Rclone will do its best to transfer the best file it has so in 891 practice this should not cause a problem. Think of `--order-by` as 892 being more of a best efforts flag rather than a perfect ordering. 893 894 ### --password-command SpaceSepList ### 895 896 This flag supplies a program which should supply the config password 897 when run. This is an alternative to rclone prompting for the password 898 or setting the `RCLONE_CONFIG_PASS` variable. 899 900 The argument to this should be a command with a space separated list 901 of arguments. If one of the arguments has a space in then enclose it 902 in `"`, if you want a literal `"` in an argument then enclose the 903 argument in `"` and double the `"`. See [CSV encoding](https://godoc.org/encoding/csv) 904 for more info. 905 906 Eg 907 908 --password-command echo hello 909 --password-command echo "hello with space" 910 --password-command echo "hello with ""quotes"" and space" 911 912 See the [Configuration Encryption](#configuration-encryption) for more info. 913 914 ### -P, --progress ### 915 916 This flag makes rclone update the stats in a static block in the 917 terminal providing a realtime overview of the transfer. 918 919 Any log messages will scroll above the static block. Log messages 920 will push the static block down to the bottom of the terminal where it 921 will stay. 922 923 Normally this is updated every 500mS but this period can be overridden 924 with the `--stats` flag. 925 926 This can be used with the `--stats-one-line` flag for a simpler 927 display. 928 929 Note: On Windows until [this bug](https://github.com/Azure/go-ansiterm/issues/26) 930 is fixed all non-ASCII characters will be replaced with `.` when 931 `--progress` is in use. 932 933 ### -q, --quiet ### 934 935 Normally rclone outputs stats and a completion message. If you set 936 this flag it will make as little output as possible. 937 938 ### --retries int ### 939 940 Retry the entire sync if it fails this many times it fails (default 3). 941 942 Some remotes can be unreliable and a few retries help pick up the 943 files which didn't get transferred because of errors. 944 945 Disable retries with `--retries 1`. 946 947 ### --retries-sleep=TIME ### 948 949 This sets the interval between each retry specified by `--retries` 950 951 The default is 0. Use 0 to disable. 952 953 ### --size-only ### 954 955 Normally rclone will look at modification time and size of files to 956 see if they are equal. If you set this flag then rclone will check 957 only the size. 958 959 This can be useful transferring files from Dropbox which have been 960 modified by the desktop sync client which doesn't set checksums of 961 modification times in the same way as rclone. 962 963 ### --stats=TIME ### 964 965 Commands which transfer data (`sync`, `copy`, `copyto`, `move`, 966 `moveto`) will print data transfer stats at regular intervals to show 967 their progress. 968 969 This sets the interval. 970 971 The default is `1m`. Use 0 to disable. 972 973 If you set the stats interval then all commands can show stats. This 974 can be useful when running other commands, `check` or `mount` for 975 example. 976 977 Stats are logged at `INFO` level by default which means they won't 978 show at default log level `NOTICE`. Use `--stats-log-level NOTICE` or 979 `-v` to make them show. See the [Logging section](#logging) for more 980 info on log levels. 981 982 Note that on macOS you can send a SIGINFO (which is normally ctrl-T in 983 the terminal) to make the stats print immediately. 984 985 ### --stats-file-name-length integer ### 986 By default, the `--stats` output will truncate file names and paths longer 987 than 40 characters. This is equivalent to providing 988 `--stats-file-name-length 40`. Use `--stats-file-name-length 0` to disable 989 any truncation of file names printed by stats. 990 991 ### --stats-log-level string ### 992 993 Log level to show `--stats` output at. This can be `DEBUG`, `INFO`, 994 `NOTICE`, or `ERROR`. The default is `INFO`. This means at the 995 default level of logging which is `NOTICE` the stats won't show - if 996 you want them to then use `--stats-log-level NOTICE`. See the [Logging 997 section](#logging) for more info on log levels. 998 999 ### --stats-one-line ### 1000 1001 When this is specified, rclone condenses the stats into a single line 1002 showing the most important stats only. 1003 1004 ### --stats-one-line-date ### 1005 1006 When this is specified, rclone enables the single-line stats and prepends 1007 the display with a date string. The default is `2006/01/02 15:04:05 - ` 1008 1009 ### --stats-one-line-date-format ### 1010 1011 When this is specified, rclone enables the single-line stats and prepends 1012 the display with a user-supplied date string. The date string MUST be 1013 enclosed in quotes. Follow [golang specs](https://golang.org/pkg/time/#Time.Format) for 1014 date formatting syntax. 1015 1016 ### --stats-unit=bits|bytes ### 1017 1018 By default, data transfer rates will be printed in bytes/second. 1019 1020 This option allows the data rate to be printed in bits/second. 1021 1022 Data transfer volume will still be reported in bytes. 1023 1024 The rate is reported as a binary unit, not SI unit. So 1 Mbit/s 1025 equals 1,048,576 bits/s and not 1,000,000 bits/s. 1026 1027 The default is `bytes`. 1028 1029 ### --suffix=SUFFIX ### 1030 1031 When using `sync`, `copy` or `move` any files which would have been 1032 overwritten or deleted will have the suffix added to them. If there 1033 is a file with the same path (after the suffix has been added), then 1034 it will be overwritten. 1035 1036 The remote in use must support server side move or copy and you must 1037 use the same remote as the destination of the sync. 1038 1039 This is for use with files to add the suffix in the current directory 1040 or with `--backup-dir`. See `--backup-dir` for more info. 1041 1042 For example 1043 1044 rclone sync /path/to/local/file remote:current --suffix .bak 1045 1046 will sync `/path/to/local` to `remote:current`, but for any files 1047 which would have been updated or deleted have .bak added. 1048 1049 ### --suffix-keep-extension ### 1050 1051 When using `--suffix`, setting this causes rclone put the SUFFIX 1052 before the extension of the files that it backs up rather than after. 1053 1054 So let's say we had `--suffix -2019-01-01`, without the flag `file.txt` 1055 would be backed up to `file.txt-2019-01-01` and with the flag it would 1056 be backed up to `file-2019-01-01.txt`. This can be helpful to make 1057 sure the suffixed files can still be opened. 1058 1059 ### --syslog ### 1060 1061 On capable OSes (not Windows or Plan9) send all log output to syslog. 1062 1063 This can be useful for running rclone in a script or `rclone mount`. 1064 1065 ### --syslog-facility string ### 1066 1067 If using `--syslog` this sets the syslog facility (eg `KERN`, `USER`). 1068 See `man syslog` for a list of possible facilities. The default 1069 facility is `DAEMON`. 1070 1071 ### --tpslimit float ### 1072 1073 Limit HTTP transactions per second to this. Default is 0 which is used 1074 to mean unlimited transactions per second. 1075 1076 For example to limit rclone to 10 HTTP transactions per second use 1077 `--tpslimit 10`, or to 1 transaction every 2 seconds use `--tpslimit 1078 0.5`. 1079 1080 Use this when the number of transactions per second from rclone is 1081 causing a problem with the cloud storage provider (eg getting you 1082 banned or rate limited). 1083 1084 This can be very useful for `rclone mount` to control the behaviour of 1085 applications using it. 1086 1087 See also `--tpslimit-burst`. 1088 1089 ### --tpslimit-burst int ### 1090 1091 Max burst of transactions for `--tpslimit`. (default 1) 1092 1093 Normally `--tpslimit` will do exactly the number of transaction per 1094 second specified. However if you supply `--tps-burst` then rclone can 1095 save up some transactions from when it was idle giving a burst of up 1096 to the parameter supplied. 1097 1098 For example if you provide `--tpslimit-burst 10` then if rclone has 1099 been idle for more than 10*`--tpslimit` then it can do 10 transactions 1100 very quickly before they are limited again. 1101 1102 This may be used to increase performance of `--tpslimit` without 1103 changing the long term average number of transactions per second. 1104 1105 ### --track-renames ### 1106 1107 By default, rclone doesn't keep track of renamed files, so if you 1108 rename a file locally then sync it to a remote, rclone will delete the 1109 old file on the remote and upload a new copy. 1110 1111 If you use this flag, and the remote supports server side copy or 1112 server side move, and the source and destination have a compatible 1113 hash, then this will track renames during `sync` 1114 operations and perform renaming server-side. 1115 1116 Files will be matched by size and hash - if both match then a rename 1117 will be considered. 1118 1119 If the destination does not support server-side copy or move, rclone 1120 will fall back to the default behaviour and log an error level message 1121 to the console. Note: Encrypted destinations are not supported 1122 by `--track-renames`. 1123 1124 Note that `--track-renames` is incompatible with `--no-traverse` and 1125 that it uses extra memory to keep track of all the rename candidates. 1126 1127 Note also that `--track-renames` is incompatible with 1128 `--delete-before` and will select `--delete-after` instead of 1129 `--delete-during`. 1130 1131 ### --delete-(before,during,after) ### 1132 1133 This option allows you to specify when files on your destination are 1134 deleted when you sync folders. 1135 1136 Specifying the value `--delete-before` will delete all files present 1137 on the destination, but not on the source *before* starting the 1138 transfer of any new or updated files. This uses two passes through the 1139 file systems, one for the deletions and one for the copies. 1140 1141 Specifying `--delete-during` will delete files while checking and 1142 uploading files. This is the fastest option and uses the least memory. 1143 1144 Specifying `--delete-after` (the default value) will delay deletion of 1145 files until all new/updated files have been successfully transferred. 1146 The files to be deleted are collected in the copy pass then deleted 1147 after the copy pass has completed successfully. The files to be 1148 deleted are held in memory so this mode may use more memory. This is 1149 the safest mode as it will only delete files if there have been no 1150 errors subsequent to that. If there have been errors before the 1151 deletions start then you will get the message `not deleting files as 1152 there were IO errors`. 1153 1154 ### --fast-list ### 1155 1156 When doing anything which involves a directory listing (eg `sync`, 1157 `copy`, `ls` - in fact nearly every command), rclone normally lists a 1158 directory and processes it before using more directory lists to 1159 process any subdirectories. This can be parallelised and works very 1160 quickly using the least amount of memory. 1161 1162 However, some remotes have a way of listing all files beneath a 1163 directory in one (or a small number) of transactions. These tend to 1164 be the bucket based remotes (eg S3, B2, GCS, Swift, Hubic). 1165 1166 If you use the `--fast-list` flag then rclone will use this method for 1167 listing directories. This will have the following consequences for 1168 the listing: 1169 1170 * It **will** use fewer transactions (important if you pay for them) 1171 * It **will** use more memory. Rclone has to load the whole listing into memory. 1172 * It *may* be faster because it uses fewer transactions 1173 * It *may* be slower because it can't be parallelized 1174 1175 rclone should always give identical results with and without 1176 `--fast-list`. 1177 1178 If you pay for transactions and can fit your entire sync listing into 1179 memory then `--fast-list` is recommended. If you have a very big sync 1180 to do then don't use `--fast-list` otherwise you will run out of 1181 memory. 1182 1183 If you use `--fast-list` on a remote which doesn't support it, then 1184 rclone will just ignore it. 1185 1186 ### --timeout=TIME ### 1187 1188 This sets the IO idle timeout. If a transfer has started but then 1189 becomes idle for this long it is considered broken and disconnected. 1190 1191 The default is `5m`. Set to 0 to disable. 1192 1193 ### --transfers=N ### 1194 1195 The number of file transfers to run in parallel. It can sometimes be 1196 useful to set this to a smaller number if the remote is giving a lot 1197 of timeouts or bigger if you have lots of bandwidth and a fast remote. 1198 1199 The default is to run 4 file transfers in parallel. 1200 1201 ### -u, --update ### 1202 1203 This forces rclone to skip any files which exist on the destination 1204 and have a modified time that is newer than the source file. 1205 1206 This can be useful when transferring to a remote which doesn't support 1207 mod times directly (or when using `--use-server-modtime` to avoid extra 1208 API calls) as it is more accurate than a `--size-only` check and faster 1209 than using `--checksum`. 1210 1211 If an existing destination file has a modification time equal (within 1212 the computed modify window precision) to the source file's, it will be 1213 updated if the sizes are different. If `--checksum` is set then 1214 rclone will update the destination if the checksums differ too. 1215 1216 If an existing destination file is older than the source file then 1217 it will be updated if the size or checksum differs from the source file. 1218 1219 On remotes which don't support mod time directly (or when using 1220 `--use-server-modtime`) the time checked will be the uploaded time. 1221 This means that if uploading to one of these remotes, rclone will skip 1222 any files which exist on the destination and have an uploaded time that 1223 is newer than the modification time of the source file. 1224 1225 ### --use-mmap ### 1226 1227 If this flag is set then rclone will use anonymous memory allocated by 1228 mmap on Unix based platforms and VirtualAlloc on Windows for its 1229 transfer buffers (size controlled by `--buffer-size`). Memory 1230 allocated like this does not go on the Go heap and can be returned to 1231 the OS immediately when it is finished with. 1232 1233 If this flag is not set then rclone will allocate and free the buffers 1234 using the Go memory allocator which may use more memory as memory 1235 pages are returned less aggressively to the OS. 1236 1237 It is possible this does not work well on all platforms so it is 1238 disabled by default; in the future it may be enabled by default. 1239 1240 ### --use-server-modtime ### 1241 1242 Some object-store backends (e.g, Swift, S3) do not preserve file modification 1243 times (modtime). On these backends, rclone stores the original modtime as 1244 additional metadata on the object. By default it will make an API call to 1245 retrieve the metadata when the modtime is needed by an operation. 1246 1247 Use this flag to disable the extra API call and rely instead on the server's 1248 modified time. In cases such as a local to remote sync using `--update`, 1249 knowing the local file is newer than the time it was last uploaded to the 1250 remote is sufficient. In those cases, this flag can speed up the process and 1251 reduce the number of API calls necessary. 1252 1253 Using this flag on a sync operation without also using `--update` would cause 1254 all files modified at any time other than the last upload time to be uploaded 1255 again, which is probably not what you want. 1256 1257 ### -v, -vv, --verbose ### 1258 1259 With `-v` rclone will tell you about each file that is transferred and 1260 a small number of significant events. 1261 1262 With `-vv` rclone will become very verbose telling you about every 1263 file it considers and transfers. Please send bug reports with a log 1264 with this setting. 1265 1266 ### -V, --version ### 1267 1268 Prints the version number 1269 1270 SSL/TLS options 1271 --------------- 1272 1273 The outoing SSL/TLS connections rclone makes can be controlled with 1274 these options. For example this can be very useful with the HTTP or 1275 WebDAV backends. Rclone HTTP servers have their own set of 1276 configuration for SSL/TLS which you can find in their documentation. 1277 1278 ### --ca-cert string 1279 1280 This loads the PEM encoded certificate authority certificate and uses 1281 it to verify the certificates of the servers rclone connects to. 1282 1283 If you have generated certificates signed with a local CA then you 1284 will need this flag to connect to servers using those certificates. 1285 1286 ### --client-cert string 1287 1288 This loads the PEM encoded client side certificate. 1289 1290 This is used for [mutual TLS authentication](https://en.wikipedia.org/wiki/Mutual_authentication). 1291 1292 The `--client-key` flag is required too when using this. 1293 1294 ### --client-key string 1295 1296 This loads the PEM encoded client side private key used for mutual TLS 1297 authentication. Used in conjunction with `--client-cert`. 1298 1299 ### --no-check-certificate=true/false ### 1300 1301 `--no-check-certificate` controls whether a client verifies the 1302 server's certificate chain and host name. 1303 If `--no-check-certificate` is true, TLS accepts any certificate 1304 presented by the server and any host name in that certificate. 1305 In this mode, TLS is susceptible to man-in-the-middle attacks. 1306 1307 This option defaults to `false`. 1308 1309 **This should be used only for testing.** 1310 1311 Configuration Encryption 1312 ------------------------ 1313 Your configuration file contains information for logging in to 1314 your cloud services. This means that you should keep your 1315 `.rclone.conf` file in a secure location. 1316 1317 If you are in an environment where that isn't possible, you can 1318 add a password to your configuration. This means that you will 1319 have to supply the password every time you start rclone. 1320 1321 To add a password to your rclone configuration, execute `rclone config`. 1322 1323 ``` 1324 >rclone config 1325 Current remotes: 1326 1327 e) Edit existing remote 1328 n) New remote 1329 d) Delete remote 1330 s) Set configuration password 1331 q) Quit config 1332 e/n/d/s/q> 1333 ``` 1334 1335 Go into `s`, Set configuration password: 1336 ``` 1337 e/n/d/s/q> s 1338 Your configuration is not encrypted. 1339 If you add a password, you will protect your login information to cloud services. 1340 a) Add Password 1341 q) Quit to main menu 1342 a/q> a 1343 Enter NEW configuration password: 1344 password: 1345 Confirm NEW password: 1346 password: 1347 Password set 1348 Your configuration is encrypted. 1349 c) Change Password 1350 u) Unencrypt configuration 1351 q) Quit to main menu 1352 c/u/q> 1353 ``` 1354 1355 Your configuration is now encrypted, and every time you start rclone 1356 you will have to supply the password. See below for details. 1357 In the same menu, you can change the password or completely remove 1358 encryption from your configuration. 1359 1360 There is no way to recover the configuration if you lose your password. 1361 1362 rclone uses [nacl secretbox](https://godoc.org/golang.org/x/crypto/nacl/secretbox) 1363 which in turn uses XSalsa20 and Poly1305 to encrypt and authenticate 1364 your configuration with secret-key cryptography. 1365 The password is SHA-256 hashed, which produces the key for secretbox. 1366 The hashed password is not stored. 1367 1368 While this provides very good security, we do not recommend storing 1369 your encrypted rclone configuration in public if it contains sensitive 1370 information, maybe except if you use a very strong password. 1371 1372 If it is safe in your environment, you can set the `RCLONE_CONFIG_PASS` 1373 environment variable to contain your password, in which case it will be 1374 used for decrypting the configuration. 1375 1376 You can set this for a session from a script. For unix like systems 1377 save this to a file called `set-rclone-password`: 1378 1379 ``` 1380 #!/bin/echo Source this file don't run it 1381 1382 read -s RCLONE_CONFIG_PASS 1383 export RCLONE_CONFIG_PASS 1384 ``` 1385 1386 Then source the file when you want to use it. From the shell you 1387 would do `source set-rclone-password`. It will then ask you for the 1388 password and set it in the environment variable. 1389 1390 An alternate means of supplying the password is to provide a script 1391 which will retrieve the password and print on standard output. This 1392 script should have a fully specified path name and not rely on any 1393 environment variables. The script is supplied either via 1394 `--password-command="..."` command line argument or via the 1395 `RCLONE_PASSWORD_COMMAND` environment variable. 1396 1397 One useful example of this is using the `passwordstore` application 1398 to retrieve the password: 1399 1400 ``` 1401 export RCLONE_PASSWORD_COMMAND="pass rclone/config" 1402 ``` 1403 1404 If the `passwordstore` password manager holds the password for the 1405 rclone configuration, using the script method means the password 1406 is primarily protected by the `passwordstore` system, and is never 1407 embedded in the clear in scripts, nor available for examination 1408 using the standard commands available. It is quite possible with 1409 long running rclone sessions for copies of passwords to be innocently 1410 captured in log files or terminal scroll buffers, etc. Using the 1411 script method of supplying the password enhances the security of 1412 the config password considerably. 1413 1414 If you are running rclone inside a script, unless you are using the 1415 `--password-command` method, you might want to disable 1416 password prompts. To do that, pass the parameter 1417 `--ask-password=false` to rclone. This will make rclone fail instead 1418 of asking for a password if `RCLONE_CONFIG_PASS` doesn't contain 1419 a valid password, and `--password-command` has not been supplied. 1420 1421 1422 Developer options 1423 ----------------- 1424 1425 These options are useful when developing or debugging rclone. There 1426 are also some more remote specific options which aren't documented 1427 here which are used for testing. These start with remote name eg 1428 `--drive-test-option` - see the docs for the remote in question. 1429 1430 ### --cpuprofile=FILE ### 1431 1432 Write CPU profile to file. This can be analysed with `go tool pprof`. 1433 1434 #### --dump flag,flag,flag #### 1435 1436 The `--dump` flag takes a comma separated list of flags to dump info 1437 about. 1438 1439 Note that some headers including `Accept-Encoding` as shown may not 1440 be correct in the request and the response may not show `Content-Encoding` 1441 if the go standard libraries auto gzip encoding was in effect. In this case 1442 the body of the request will be gunzipped before showing it. 1443 1444 The available flags are: 1445 1446 #### --dump headers #### 1447 1448 Dump HTTP headers with `Authorization:` lines removed. May still 1449 contain sensitive info. Can be very verbose. Useful for debugging 1450 only. 1451 1452 Use `--dump auth` if you do want the `Authorization:` headers. 1453 1454 #### --dump bodies #### 1455 1456 Dump HTTP headers and bodies - may contain sensitive info. Can be 1457 very verbose. Useful for debugging only. 1458 1459 Note that the bodies are buffered in memory so don't use this for 1460 enormous files. 1461 1462 #### --dump requests #### 1463 1464 Like `--dump bodies` but dumps the request bodies and the response 1465 headers. Useful for debugging download problems. 1466 1467 #### --dump responses #### 1468 1469 Like `--dump bodies` but dumps the response bodies and the request 1470 headers. Useful for debugging upload problems. 1471 1472 #### --dump auth #### 1473 1474 Dump HTTP headers - will contain sensitive info such as 1475 `Authorization:` headers - use `--dump headers` to dump without 1476 `Authorization:` headers. Can be very verbose. Useful for debugging 1477 only. 1478 1479 #### --dump filters #### 1480 1481 Dump the filters to the output. Useful to see exactly what include 1482 and exclude options are filtering on. 1483 1484 #### --dump goroutines #### 1485 1486 This dumps a list of the running go-routines at the end of the command 1487 to standard output. 1488 1489 #### --dump openfiles #### 1490 1491 This dumps a list of the open files at the end of the command. It 1492 uses the `lsof` command to do that so you'll need that installed to 1493 use it. 1494 1495 ### --memprofile=FILE ### 1496 1497 Write memory profile to file. This can be analysed with `go tool pprof`. 1498 1499 Filtering 1500 --------- 1501 1502 For the filtering options 1503 1504 * `--delete-excluded` 1505 * `--filter` 1506 * `--filter-from` 1507 * `--exclude` 1508 * `--exclude-from` 1509 * `--include` 1510 * `--include-from` 1511 * `--files-from` 1512 * `--min-size` 1513 * `--max-size` 1514 * `--min-age` 1515 * `--max-age` 1516 * `--dump filters` 1517 1518 See the [filtering section](/filtering/). 1519 1520 Remote control 1521 -------------- 1522 1523 For the remote control options and for instructions on how to remote control rclone 1524 1525 * `--rc` 1526 * and anything starting with `--rc-` 1527 1528 See [the remote control section](/rc/). 1529 1530 Logging 1531 ------- 1532 1533 rclone has 4 levels of logging, `ERROR`, `NOTICE`, `INFO` and `DEBUG`. 1534 1535 By default, rclone logs to standard error. This means you can redirect 1536 standard error and still see the normal output of rclone commands (eg 1537 `rclone ls`). 1538 1539 By default, rclone will produce `Error` and `Notice` level messages. 1540 1541 If you use the `-q` flag, rclone will only produce `Error` messages. 1542 1543 If you use the `-v` flag, rclone will produce `Error`, `Notice` and 1544 `Info` messages. 1545 1546 If you use the `-vv` flag, rclone will produce `Error`, `Notice`, 1547 `Info` and `Debug` messages. 1548 1549 You can also control the log levels with the `--log-level` flag. 1550 1551 If you use the `--log-file=FILE` option, rclone will redirect `Error`, 1552 `Info` and `Debug` messages along with standard error to FILE. 1553 1554 If you use the `--syslog` flag then rclone will log to syslog and the 1555 `--syslog-facility` control which facility it uses. 1556 1557 Rclone prefixes all log messages with their level in capitals, eg INFO 1558 which makes it easy to grep the log file for different kinds of 1559 information. 1560 1561 Exit Code 1562 --------- 1563 1564 If any errors occur during the command execution, rclone will exit with a 1565 non-zero exit code. This allows scripts to detect when rclone 1566 operations have failed. 1567 1568 During the startup phase, rclone will exit immediately if an error is 1569 detected in the configuration. There will always be a log message 1570 immediately before exiting. 1571 1572 When rclone is running it will accumulate errors as it goes along, and 1573 only exit with a non-zero exit code if (after retries) there were 1574 still failed transfers. For every error counted there will be a high 1575 priority log message (visible with `-q`) showing the message and 1576 which file caused the problem. A high priority message is also shown 1577 when starting a retry so the user can see that any previous error 1578 messages may not be valid after the retry. If rclone has done a retry 1579 it will log a high priority message if the retry was successful. 1580 1581 ### List of exit codes ### 1582 * `0` - success 1583 * `1` - Syntax or usage error 1584 * `2` - Error not otherwise categorised 1585 * `3` - Directory not found 1586 * `4` - File not found 1587 * `5` - Temporary error (one that more retries might fix) (Retry errors) 1588 * `6` - Less serious errors (like 461 errors from dropbox) (NoRetry errors) 1589 * `7` - Fatal error (one that more retries won't fix, like account suspended) (Fatal errors) 1590 * `8` - Transfer exceeded - limit set by --max-transfer reached 1591 1592 Environment Variables 1593 --------------------- 1594 1595 Rclone can be configured entirely using environment variables. These 1596 can be used to set defaults for options or config file entries. 1597 1598 ### Options ### 1599 1600 Every option in rclone can have its default set by environment 1601 variable. 1602 1603 To find the name of the environment variable, first, take the long 1604 option name, strip the leading `--`, change `-` to `_`, make 1605 upper case and prepend `RCLONE_`. 1606 1607 For example, to always set `--stats 5s`, set the environment variable 1608 `RCLONE_STATS=5s`. If you set stats on the command line this will 1609 override the environment variable setting. 1610 1611 Or to always use the trash in drive `--drive-use-trash`, set 1612 `RCLONE_DRIVE_USE_TRASH=true`. 1613 1614 The same parser is used for the options and the environment variables 1615 so they take exactly the same form. 1616 1617 ### Config file ### 1618 1619 You can set defaults for values in the config file on an individual 1620 remote basis. If you want to use this feature, you will need to 1621 discover the name of the config items that you want. The easiest way 1622 is to run through `rclone config` by hand, then look in the config 1623 file to see what the values are (the config file can be found by 1624 looking at the help for `--config` in `rclone help`). 1625 1626 To find the name of the environment variable, you need to set, take 1627 `RCLONE_CONFIG_` + name of remote + `_` + name of config file option 1628 and make it all uppercase. 1629 1630 For example, to configure an S3 remote named `mys3:` without a config 1631 file (using unix ways of setting environment variables): 1632 1633 ``` 1634 $ export RCLONE_CONFIG_MYS3_TYPE=s3 1635 $ export RCLONE_CONFIG_MYS3_ACCESS_KEY_ID=XXX 1636 $ export RCLONE_CONFIG_MYS3_SECRET_ACCESS_KEY=XXX 1637 $ rclone lsd MYS3: 1638 -1 2016-09-21 12:54:21 -1 my-bucket 1639 $ rclone listremotes | grep mys3 1640 mys3: 1641 ``` 1642 1643 Note that if you want to create a remote using environment variables 1644 you must create the `..._TYPE` variable as above. 1645 1646 ### Other environment variables ### 1647 1648 * RCLONE_CONFIG_PASS` set to contain your config file password (see [Configuration Encryption](#configuration-encryption) section) 1649 * HTTP_PROXY, HTTPS_PROXY and NO_PROXY (or the lowercase versions thereof). 1650 * HTTPS_PROXY takes precedence over HTTP_PROXY for https requests. 1651 * The environment values may be either a complete URL or a "host[:port]" for, in which case the "http" scheme is assumed.