forked from rclone/rclone
-
Notifications
You must be signed in to change notification settings - Fork 0
/
MANUAL.html
2430 lines (2426 loc) · 135 KB
/
MANUAL.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta name="generator" content="pandoc" />
<meta name="author" content="Nick Craig-Wood" />
<title>rclone(1) User Manual</title>
<style type="text/css">code{white-space: pre;}</style>
</head>
<body>
<div id="header">
<h1 class="title">rclone(1) User Manual</h1>
<h2 class="author">Nick Craig-Wood</h2>
<h3 class="date">Apr 18, 2016</h3>
</div>
<h1 id="rclone">Rclone</h1>
<p><a href="http://rclone.org/"><img src="http://rclone.org/img/rclone-120x120.png" alt="Logo" /></a></p>
<p>Rclone is a command line program to sync files and directories to and from</p>
<ul>
<li>Google Drive</li>
<li>Amazon S3</li>
<li>Openstack Swift / Rackspace cloud files / Memset Memstore</li>
<li>Dropbox</li>
<li>Google Cloud Storage</li>
<li>Amazon Cloud Drive</li>
<li>Microsoft One Drive</li>
<li>Hubic</li>
<li>Backblaze B2</li>
<li>Yandex Disk</li>
<li>The local filesystem</li>
</ul>
<p>Features</p>
<ul>
<li>MD5/SHA1 hashes checked at all times for file integrity</li>
<li>Timestamps preserved on files</li>
<li>Partial syncs supported on a whole file basis</li>
<li>Copy mode to just copy new/changed files</li>
<li>Sync (one way) mode to make a directory identical</li>
<li>Check mode to check for file hash equality</li>
<li>Can sync to and from network, eg two different cloud accounts</li>
</ul>
<p>Links</p>
<ul>
<li><a href="http://rclone.org/">Home page</a></li>
<li><a href="http://github.com/ncw/rclone">Github project page for source and bug tracker</a></li>
<li><a href="https://google.com/+RcloneOrg" rel="publisher">Google+ page</a>
</li></li>
<li><a href="http://rclone.org/downloads/">Downloads</a></li>
</ul>
<h2 id="install">Install</h2>
<p>Rclone is a Go program and comes as a single binary file.</p>
<p><a href="http://rclone.org/downloads/">Download</a> the relevant binary.</p>
<p>Or alternatively if you have Go 1.5+ installed use</p>
<pre><code>go get github.com/ncw/rclone</code></pre>
<p>and this will build the binary in <code>$GOPATH/bin</code>. If you have built rclone before then you will want to update its dependencies first with this</p>
<pre><code>go get -u -v github.com/ncw/rclone/...</code></pre>
<p>See the <a href="http://rclone.org/docs/">Usage section</a> of the docs for how to use rclone, or run <code>rclone -h</code>.</p>
<h2 id="linux-binary-downloaded-files-install-example">linux binary downloaded files install example</h2>
<pre><code>unzip rclone-v1.17-linux-amd64.zip
cd rclone-v1.17-linux-amd64
#copy binary file
sudo cp rclone /usr/sbin/
sudo chown root:root /usr/sbin/rclone
sudo chmod 755 /usr/sbin/rclone
#install manpage
sudo mkdir -p /usr/local/share/man/man1
sudo cp rclone.1 /usr/local/share/man/man1/
sudo mandb</code></pre>
<h2 id="configure">Configure</h2>
<p>First you'll need to configure rclone. As the object storage systems have quite complicated authentication these are kept in a config file <code>.rclone.conf</code> in your home directory by default. (You can use the <code>--config</code> option to choose a different config file.)</p>
<p>The easiest way to make the config is to run rclone with the config option:</p>
<pre><code>rclone config</code></pre>
<p>See the following for detailed instructions for</p>
<ul>
<li><a href="http://rclone.org/drive/">Google drive</a></li>
<li><a href="http://rclone.org/s3/">Amazon S3</a></li>
<li><a href="http://rclone.org/swift/">Swift / Rackspace Cloudfiles / Memset Memstore</a></li>
<li><a href="http://rclone.org/dropbox/">Dropbox</a></li>
<li><a href="http://rclone.org/googlecloudstorage/">Google Cloud Storage</a></li>
<li><a href="http://rclone.org/local/">Local filesystem</a></li>
<li><a href="http://rclone.org/amazonclouddrive/">Amazon Cloud Drive</a></li>
<li><a href="http://rclone.org/b2/">Backblaze B2</a></li>
<li><a href="http://rclone.org/hubic/">Hubic</a></li>
<li><a href="http://rclone.org/onedrive/">Microsoft One Drive</a></li>
<li><a href="http://rclone.org/yandex/">Yandex Disk</a></li>
</ul>
<h2 id="usage">Usage</h2>
<p>Rclone syncs a directory tree from one storage system to another.</p>
<p>Its syntax is like this</p>
<pre><code>Syntax: [options] subcommand <parameters> <parameters...></code></pre>
<p>Source and destination paths are specified by the name you gave the storage system in the config file then the sub path, eg "drive:myfolder" to look at "myfolder" in Google drive.</p>
<p>You can define as many storage paths as you like in the config file.</p>
<h2 id="subcommands">Subcommands</h2>
<h3 id="rclone-copy-sourcepath-destpath">rclone copy source:path dest:path</h3>
<p>Copy the source to the destination. Doesn't transfer unchanged files, testing by size and modification time or MD5SUM. Doesn't delete files from the destination.</p>
<p>Note that it is always the contents of the directory that is synced, not the directory so when source:path is a directory, it's the contents of source:path that are copied, not the directory name and contents.</p>
<p>If dest:path doesn't exist, it is created and the source:path contents go there.</p>
<p>For example</p>
<pre><code>rclone copy source:sourcepath dest:destpath</code></pre>
<p>Let's say there are two files in sourcepath</p>
<pre><code>sourcepath/one.txt
sourcepath/two.txt</code></pre>
<p>This copies them to</p>
<pre><code>destpath/one.txt
destpath/two.txt</code></pre>
<p>Not to</p>
<pre><code>destpath/sourcepath/one.txt
destpath/sourcepath/two.txt</code></pre>
<p>If you are familiar with <code>rsync</code>, rclone always works as if you had written a trailing / - meaning "copy the contents of this directory". This applies to all commands and whether you are talking about the source or destination.</p>
<h3 id="rclone-sync-sourcepath-destpath">rclone sync source:path dest:path</h3>
<p>Sync the source to the destination, changing the destination only. Doesn't transfer unchanged files, testing by size and modification time or MD5SUM. Destination is updated to match source, including deleting files if necessary.</p>
<p><strong>Important</strong>: Since this can cause data loss, test first with the <code>--dry-run</code> flag to see exactly what would be copied and deleted.</p>
<p>Note that files in the destination won't be deleted if there were any errors at any point.</p>
<p>It is always the contents of the directory that is synced, not the directory so when source:path is a directory, it's the contents of source:path that are copied, not the directory name and contents. See extended explanation in the <code>copy</code> command above if unsure.</p>
<p>If dest:path doesn't exist, it is created and the source:path contents go there.</p>
<h3 id="move-sourcepath-destpath">move source:path dest:path</h3>
<p>Moves the source to the destination.</p>
<p>If there are no filters in use this is equivalent to a copy followed by a purge, but may using server side operations to speed it up if possible.</p>
<p>If filters are in use then it is equivalent to a copy followed by delete, followed by an rmdir (which only removes the directory if empty). The individual file moves will be moved with srver side operations if possible.</p>
<p><strong>Important</strong>: Since this can cause data loss, test first with the --dry-run flag.</p>
<h3 id="rclone-ls-remotepath">rclone ls remote:path</h3>
<p>List all the objects in the the path with size and path.</p>
<h3 id="rclone-lsd-remotepath">rclone lsd remote:path</h3>
<p>List all directories/containers/buckets in the the path.</p>
<h3 id="rclone-lsl-remotepath">rclone lsl remote:path</h3>
<p>List all the objects in the the path with modification time, size and path.</p>
<h3 id="rclone-md5sum-remotepath">rclone md5sum remote:path</h3>
<p>Produces an md5sum file for all the objects in the path. This is in the same format as the standard md5sum tool produces.</p>
<h3 id="rclone-sha1sum-remotepath">rclone sha1sum remote:path</h3>
<p>Produces an sha1sum file for all the objects in the path. This is in the same format as the standard sha1sum tool produces.</p>
<h3 id="rclone-size-remotepath">rclone size remote:path</h3>
<p>Prints the total size of objects in remote:path and the number of objects.</p>
<h3 id="rclone-mkdir-remotepath">rclone mkdir remote:path</h3>
<p>Make the path if it doesn't already exist</p>
<h3 id="rclone-rmdir-remotepath">rclone rmdir remote:path</h3>
<p>Remove the path. Note that you can't remove a path with objects in it, use purge for that.</p>
<h3 id="rclone-purge-remotepath">rclone purge remote:path</h3>
<p>Remove the path and all of its contents. Note that this does not obey include/exclude filters - everything will be removed. Use <code>delete</code> if you want to selectively delete files.</p>
<h3 id="rclone-delete-remotepath">rclone delete remote:path</h3>
<p>Remove the contents of path. Unlike <code>purge</code> it obeys include/exclude filters so can be used to selectively delete files.</p>
<p>Eg delete all files bigger than 100MBytes</p>
<p>Check what would be deleted first (use either)</p>
<pre><code>rclone --min-size 100M lsl remote:path
rclone --dry-run --min-size 100M delete remote:path</code></pre>
<p>Then delete</p>
<pre><code>rclone --min-size 100M delete remote:path</code></pre>
<p>That reads "delete everything with a minimum size of 100 MB", hence delete all files bigger than 100MBytes.</p>
<h3 id="rclone-check-sourcepath-destpath">rclone check source:path dest:path</h3>
<p>Checks the files in the source and destination match. It compares sizes and MD5SUMs and prints a report of files which don't match. It doesn't alter the source or destination.</p>
<p><code>--size-only</code> may be used to only compare the sizes, not the MD5SUMs.</p>
<h3 id="rclone-dedupe-remotepath">rclone dedupe remote:path</h3>
<p>By default <code>dedup</code> interactively finds duplicate files and offers to delete all but one or rename them to be different. Only useful with Google Drive which can have duplicate file names.</p>
<p>The <code>dedupe</code> command will delete all but one of any identical (same md5sum) files it finds without confirmation. This means that for most duplicated files the <code>dedupe</code> command will not be interactive. You can use <code>--dry-run</code> to see what would happen without doing anything.</p>
<p>Here is an example run.</p>
<p>Before - with duplicates</p>
<pre><code>$ rclone lsl drive:dupes
6048320 2016-03-05 16:23:16.798000000 one.txt
6048320 2016-03-05 16:23:11.775000000 one.txt
564374 2016-03-05 16:23:06.731000000 one.txt
6048320 2016-03-05 16:18:26.092000000 one.txt
6048320 2016-03-05 16:22:46.185000000 two.txt
1744073 2016-03-05 16:22:38.104000000 two.txt
564374 2016-03-05 16:22:52.118000000 two.txt</code></pre>
<p>Now the <code>dedupe</code> session</p>
<pre><code>$ rclone dedupe drive:dupes
2016/03/05 16:24:37 Google drive root 'dupes': Looking for duplicates using interactive mode.
one.txt: Found 4 duplicates - deleting identical copies
one.txt: Deleting 2/3 identical duplicates (md5sum "1eedaa9fe86fd4b8632e2ac549403b36")
one.txt: 2 duplicates remain
1: 6048320 bytes, 2016-03-05 16:23:16.798000000, md5sum 1eedaa9fe86fd4b8632e2ac549403b36
2: 564374 bytes, 2016-03-05 16:23:06.731000000, md5sum 7594e7dc9fc28f727c42ee3e0749de81
s) Skip and do nothing
k) Keep just one (choose which in next step)
r) Rename all to be different (by changing file.jpg to file-1.jpg)
s/k/r> k
Enter the number of the file to keep> 1
one.txt: Deleted 1 extra copies
two.txt: Found 3 duplicates - deleting identical copies
two.txt: 3 duplicates remain
1: 564374 bytes, 2016-03-05 16:22:52.118000000, md5sum 7594e7dc9fc28f727c42ee3e0749de81
2: 6048320 bytes, 2016-03-05 16:22:46.185000000, md5sum 1eedaa9fe86fd4b8632e2ac549403b36
3: 1744073 bytes, 2016-03-05 16:22:38.104000000, md5sum 851957f7fb6f0bc4ce76be966d336802
s) Skip and do nothing
k) Keep just one (choose which in next step)
r) Rename all to be different (by changing file.jpg to file-1.jpg)
s/k/r> r
two-1.txt: renamed from: two.txt
two-2.txt: renamed from: two.txt
two-3.txt: renamed from: two.txt</code></pre>
<p>The result being</p>
<pre><code>$ rclone lsl drive:dupes
6048320 2016-03-05 16:23:16.798000000 one.txt
564374 2016-03-05 16:22:52.118000000 two-1.txt
6048320 2016-03-05 16:22:46.185000000 two-2.txt
1744073 2016-03-05 16:22:38.104000000 two-3.txt</code></pre>
<p>Dedupe can be run non interactively using the <code>--dedupe-mode</code> flag.</p>
<ul>
<li><code>--dedupe-mode interactive</code> - interactive as above.</li>
<li><code>--dedupe-mode skip</code> - removes identical files then skips anything left.</li>
<li><code>--dedupe-mode first</code> - removes identical files then keeps the first one.</li>
<li><code>--dedupe-mode newest</code> - removes identical files then keeps the newest one.</li>
<li><code>--dedupe-mode oldest</code> - removes identical files then keeps the oldest one.</li>
<li><code>--dedupe-mode rename</code> - removes identical files then renames the rest to be different.</li>
</ul>
<p>For example to rename all the identically named photos in your Google Photos directory, do</p>
<pre><code>rclone dedupe --dedupe-mode rename "drive:Google Photos"</code></pre>
<h3 id="rclone-config">rclone config</h3>
<p>Enter an interactive configuration session.</p>
<h3 id="rclone-help">rclone help</h3>
<p>Prints help on rclone commands and options.</p>
<h2 id="server-side-copy">Server Side Copy</h2>
<p>Drive, S3, Dropbox, Swift and Google Cloud Storage support server side copy.</p>
<p>This means if you want to copy one folder to another then rclone won't download all the files and re-upload them; it will instruct the server to copy them in place.</p>
<p>Eg</p>
<pre><code>rclone copy s3:oldbucket s3:newbucket</code></pre>
<p>Will copy the contents of <code>oldbucket</code> to <code>newbucket</code> without downloading and re-uploading.</p>
<p>Remotes which don't support server side copy (eg local) <strong>will</strong> download and re-upload in this case.</p>
<p>Server side copies are used with <code>sync</code> and <code>copy</code> and will be identified in the log when using the <code>-v</code> flag.</p>
<p>Server side copies will only be attempted if the remote names are the same.</p>
<p>This can be used when scripting to make aged backups efficiently, eg</p>
<pre><code>rclone sync remote:current-backup remote:previous-backup
rclone sync /path/to/files remote:current-backup</code></pre>
<h2 id="options">Options</h2>
<p>Rclone has a number of options to control its behaviour.</p>
<p>Options which use TIME use the go time parser. A duration string is a possibly signed sequence of decimal numbers, each with optional fraction and a unit suffix, such as "300ms", "-1.5h" or "2h45m". Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".</p>
<p>Options which use SIZE use kByte by default. However a suffix of <code>k</code> for kBytes, <code>M</code> for MBytes and <code>G</code> for GBytes may be used. These are the binary units, eg 2**10, 2**20, 2**30 respectively.</p>
<h3 id="bwlimitsize">--bwlimit=SIZE</h3>
<p>Bandwidth limit in kBytes/s, or use suffix k|M|G. The default is <code>0</code> which means to not limit bandwidth.</p>
<p>For example to limit bandwidth usage to 10 MBytes/s use <code>--bwlimit 10M</code></p>
<p>This only limits the bandwidth of the data transfer, it doesn't limit the bandwith of the directory listings etc.</p>
<h3 id="checkersn">--checkers=N</h3>
<p>The number of checkers to run in parallel. Checkers do the equality checking of files during a sync. For some storage systems (eg s3, swift, dropbox) this can take a significant amount of time so they are run in parallel.</p>
<p>The default is to run 8 checkers in parallel.</p>
<h3 id="c---checksum">-c, --checksum</h3>
<p>Normally rclone will look at modification time and size of files to see if they are equal. If you set this flag then rclone will check the file hash and size to determine if files are equal.</p>
<p>This is useful when the remote doesn't support setting modified time and a more accurate sync is desired than just checking the file size.</p>
<p>This is very useful when transferring between remotes which store the same hash type on the object, eg Drive and Swift. For details of which remotes support which hash type see the table in the <a href="http://rclone.org/overview/">overview section</a>.</p>
<p>Eg <code>rclone --checksum sync s3:/bucket swift:/bucket</code> would run much quicker than without the <code>--checksum</code> flag.</p>
<p>When using this flag, rclone won't update mtimes of remote files if they are incorrect as it would normally.</p>
<h3 id="configconfig_file">--config=CONFIG_FILE</h3>
<p>Specify the location of the rclone config file. Normally this is in your home directory as a file called <code>.rclone.conf</code>. If you run <code>rclone -h</code> and look at the help for the <code>--config</code> option you will see where the default location is for you. Use this flag to override the config location, eg <code>rclone --config=".myconfig" .config</code>.</p>
<h3 id="contimeouttime">--contimeout=TIME</h3>
<p>Set the connection timeout. This should be in go time format which looks like <code>5s</code> for 5 seconds, <code>10m</code> for 10 minutes, or <code>3h30m</code>.</p>
<p>The connection timeout is the amount of time rclone will wait for a connection to go through to a remote object storage system. It is <code>1m</code> by default.</p>
<h3 id="dedupe-mode-mode">--dedupe-mode MODE</h3>
<p>Mode to run dedupe command in. One of <code>interactive</code>, <code>skip</code>, <code>first</code>, <code>newest</code>, <code>oldest</code>, <code>rename</code>. The default is <code>interactive</code>. See the dedupe command for more information as to what these options mean.</p>
<h3 id="n---dry-run">-n, --dry-run</h3>
<p>Do a trial run with no permanent changes. Use this to see what rclone would do without actually doing it. Useful when setting up the <code>sync</code> command which deletes files in the destination.</p>
<h3 id="ignore-existing">--ignore-existing</h3>
<p>Using this option will make rclone unconditionally skip all files that exist on the destination, no matter the content of these files.</p>
<p>While this isn't a generally recommended option, it can be useful in cases where your files change due to encryption. However, it cannot correct partial transfers in case a transfer was interrupted.</p>
<h3 id="i---ignore-times">-I, --ignore-times</h3>
<p>Using this option will cause rclone to unconditionally upload all files regardless of the state of files on the destination.</p>
<p>Normally rclone would skip any files that have the same modification time and are the same size (or have the same checksum if using <code>--checksum</code>).</p>
<h3 id="log-filefile">--log-file=FILE</h3>
<p>Log all of rclone's output to FILE. This is not active by default. This can be useful for tracking down problems with syncs in combination with the <code>-v</code> flag.</p>
<h3 id="low-level-retries-number">--low-level-retries NUMBER</h3>
<p>This controls the number of low level retries rclone does.</p>
<p>A low level retry is used to retry a failing operation - typically one HTTP request. This might be uploading a chunk of a big file for example. You will see low level retries in the log with the <code>-v</code> flag.</p>
<p>This shouldn't need to be changed from the default in normal operations, however if you get a lot of low level retries you may wish to reduce the value so rclone moves on to a high level retry (see the <code>--retries</code> flag) quicker.</p>
<p>Disable low level retries with <code>--low-level-retries 1</code>.</p>
<h3 id="modify-windowtime">--modify-window=TIME</h3>
<p>When checking whether a file has been modified, this is the maximum allowed time difference that a file can have and still be considered equivalent.</p>
<p>The default is <code>1ns</code> unless this is overridden by a remote. For example OS X only stores modification times to the nearest second so if you are reading and writing to an OS X filing system this will be <code>1s</code> by default.</p>
<p>This command line flag allows you to override that computed default.</p>
<h3 id="no-gzip-encoding">--no-gzip-encoding</h3>
<p>Don't set <code>Accept-Encoding: gzip</code>. This means that rclone won't ask the server for compressed files automatically. Useful if you've set the server to return files with <code>Content-Encoding: gzip</code> but you uploaded compressed files.</p>
<p>There is no need to set this in normal operation, and doing so will decrease the network transfer efficiency of rclone.</p>
<h3 id="q---quiet">-q, --quiet</h3>
<p>Normally rclone outputs stats and a completion message. If you set this flag it will make as little output as possible.</p>
<h3 id="retries-int">--retries int</h3>
<p>Retry the entire sync if it fails this many times it fails (default 3).</p>
<p>Some remotes can be unreliable and a few retries helps pick up the files which didn't get transferred because of errors.</p>
<p>Disable retries with <code>--retries 1</code>.</p>
<h3 id="size-only">--size-only</h3>
<p>Normally rclone will look at modification time and size of files to see if they are equal. If you set this flag then rclone will check only the size.</p>
<p>This can be useful transferring files from dropbox which have been modified by the desktop sync client which doesn't set checksums of modification times in the same way as rclone.</p>
<p>When using this flag, rclone won't update mtimes of remote files if they are incorrect as it would normally.</p>
<h3 id="statstime">--stats=TIME</h3>
<p>Rclone will print stats at regular intervals to show its progress.</p>
<p>This sets the interval.</p>
<p>The default is <code>1m</code>. Use 0 to disable.</p>
<h3 id="delete-beforeduringafter">--delete-(before,during,after)</h3>
<p>This option allows you to specify when files on your destination are deleted when you sync folders.</p>
<p>Specifying the value <code>--delete-before</code> will delete all files present on the destination, but not on the source <em>before</em> starting the transfer of any new or updated files.</p>
<p>Specifying <code>--delete-during</code> (default value) will delete files while checking and uploading files. This is usually the fastest option.</p>
<p>Specifying <code>--delete-after</code> will delay deletion of files until all new/updated files have been successfully transfered.</p>
<h3 id="timeouttime">--timeout=TIME</h3>
<p>This sets the IO idle timeout. If a transfer has started but then becomes idle for this long it is considered broken and disconnected.</p>
<p>The default is <code>5m</code>. Set to 0 to disable.</p>
<h3 id="transfersn">--transfers=N</h3>
<p>The number of file transfers to run in parallel. It can sometimes be useful to set this to a smaller number if the remote is giving a lot of timeouts or bigger if you have lots of bandwidth and a fast remote.</p>
<p>The default is to run 4 file transfers in parallel.</p>
<h3 id="u---update">-u, --update</h3>
<p>This forces rclone to skip any files which exist on the destination and have a modified time that is newer than the source file.</p>
<p>If an existing destination file has a modification time equal (within the computed modify window precision) to the source file's, it will be updated if the sizes are different.</p>
<p>On remotes which don't support mod time directly the time checked will be the uploaded time. This means that if uploading to one of these remoes, rclone will skip any files which exist on the destination and have an uploaded time that is newer than the modification time of the source file.</p>
<p>This can be useful when transferring to a remote which doesn't support mod times directly as it is more accurate than a <code>--size-only</code> check and faster than using <code>--checksum</code>.</p>
<h3 id="v---verbose">-v, --verbose</h3>
<p>If you set this flag, rclone will become very verbose telling you about every file it considers and transfers.</p>
<p>Very useful for debugging.</p>
<h3 id="v---version">-V, --version</h3>
<p>Prints the version number</p>
<h2 id="configuration-encryption">Configuration Encryption</h2>
<p>Your configuration file contains information for logging in to your cloud services. This means that you should keep your <code>.rclone.conf</code> file in a secure location.</p>
<p>If you are in an environment where that isn't possible, you can add a password to your configuration. This means that you will have to enter the password every time you start rclone.</p>
<p>To add a password to your rclone configuration, execute <code>rclone config</code>.</p>
<pre><code>>rclone config
Current remotes:
e) Edit existing remote
n) New remote
d) Delete remote
s) Set configuration password
q) Quit config
e/n/d/s/q></code></pre>
<p>Go into <code>s</code>, Set configuration password:</p>
<pre><code>e/n/d/s/q> s
Your configuration is not encrypted.
If you add a password, you will protect your login information to cloud services.
a) Add Password
q) Quit to main menu
a/q> a
Enter NEW configuration password:
password>
Confirm NEW password:
password>
Password set
Your configuration is encrypted.
c) Change Password
u) Unencrypt configuration
q) Quit to main menu
c/u/q></code></pre>
<p>Your configuration is now encrypted, and every time you start rclone you will now be asked for the password. In the same menu you can change the password or completely remove encryption from your configuration.</p>
<p>There is no way to recover the configuration if you lose your password.</p>
<p>rclone uses <a href="https://godoc.org/golang.org/x/crypto/nacl/secretbox">nacl secretbox</a> which in term uses XSalsa20 and Poly1305 to encrypt and authenticate your configuration with secret-key cryptography. The password is SHA-256 hashed, which produces the key for secretbox. The hashed password is not stored.</p>
<p>While this provides very good security, we do not recommend storing your encrypted rclone configuration in public, if it contains sensitive information, maybe except if you use a very strong password.</p>
<p>If it is safe in your environment, you can set the <code>RCLONE_CONFIG_PASS</code> environment variable to contain your password, in which case it will be used for decrypting the configuration.</p>
<p>If you are running rclone inside a script, you might want to disable password prompts. To do that, pass the parameter <code>--ask-password=false</code> to rclone. This will make rclone fail instead of asking for a password, if if <code>RCLONE_CONFIG_PASS</code> doesn't contain a valid password.</p>
<h2 id="developer-options">Developer options</h2>
<p>These options are useful when developing or debugging rclone. There are also some more remote specific options which aren't documented here which are used for testing. These start with remote name eg <code>--drive-test-option</code> - see the docs for the remote in question.</p>
<h3 id="cpuprofilefile">--cpuprofile=FILE</h3>
<p>Write CPU profile to file. This can be analysed with <code>go tool pprof</code>.</p>
<h3 id="dump-bodies">--dump-bodies</h3>
<p>Dump HTTP headers and bodies - may contain sensitive info. Can be very verbose. Useful for debugging only.</p>
<h3 id="dump-filters">--dump-filters</h3>
<p>Dump the filters to the output. Useful to see exactly what include and exclude options are filtering on.</p>
<h3 id="dump-headers">--dump-headers</h3>
<p>Dump HTTP headers - may contain sensitive info. Can be very verbose. Useful for debugging only.</p>
<h3 id="memprofilefile">--memprofile=FILE</h3>
<p>Write memory profile to file. This can be analysed with <code>go tool pprof</code>.</p>
<h3 id="no-check-certificatetruefalse">--no-check-certificate=true/false</h3>
<p><code>--no-check-certificate</code> controls whether a client verifies the server's certificate chain and host name. If <code>--no-check-certificate</code> is true, TLS accepts any certificate presented by the server and any host name in that certificate. In this mode, TLS is susceptible to man-in-the-middle attacks.</p>
<p>This option defaults to <code>false</code>.</p>
<p><strong>This should be used only for testing.</strong></p>
<h2 id="filtering">Filtering</h2>
<p>For the filtering options</p>
<ul>
<li><code>--delete-excluded</code></li>
<li><code>--filter</code></li>
<li><code>--filter-from</code></li>
<li><code>--exclude</code></li>
<li><code>--exclude-from</code></li>
<li><code>--include</code></li>
<li><code>--include-from</code></li>
<li><code>--files-from</code></li>
<li><code>--min-size</code></li>
<li><code>--max-size</code></li>
<li><code>--min-age</code></li>
<li><code>--max-age</code></li>
<li><code>--dump-filters</code></li>
</ul>
<p>See the <a href="http://rclone.org/filtering/">filtering section</a>.</p>
<h2 id="exit-code">Exit Code</h2>
<p>If any errors occurred during the command, rclone will set a non zero exit code. This allows scripts to detect when rclone operations have failed.</p>
<h1 id="configuring-rclone-on-a-remote-headless-machine">Configuring rclone on a remote / headless machine</h1>
<p>Some of the configurations (those involving oauth2) require an Internet connected web browser.</p>
<p>If you are trying to set rclone up on a remote or headless box with no browser available on it (eg a NAS or a server in a datacenter) then you will need to use an alternative means of configuration. There are two ways of doing it, described below.</p>
<h2 id="configuring-using-rclone-authorize">Configuring using rclone authorize</h2>
<p>On the headless box</p>
<pre><code>...
Remote config
Use auto config?
* Say Y if not sure
* Say N if you are working on a remote or headless machine
y) Yes
n) No
y/n> n
For this to work, you will need rclone available on a machine that has a web browser available.
Execute the following on your machine:
rclone authorize "amazon cloud drive"
Then paste the result below:
result></code></pre>
<p>Then on your main desktop machine</p>
<pre><code>rclone authorize "amazon cloud drive"
If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth
Log in and authorize rclone for access
Waiting for code...
Got code
Paste the following into your remote machine --->
SECRET_TOKEN
<---End paste</code></pre>
<p>Then back to the headless box, paste in the code</p>
<pre><code>result> SECRET_TOKEN
--------------------
[acd12]
client_id =
client_secret =
token = SECRET_TOKEN
--------------------
y) Yes this is OK
e) Edit this remote
d) Delete this remote
y/e/d></code></pre>
<h2 id="configuring-by-copying-the-config-file">Configuring by copying the config file</h2>
<p>Rclone stores all of its config in a single configuration file. This can easily be copied to configure a remote rclone.</p>
<p>So first configure rclone on your desktop machine</p>
<pre><code>rclone config</code></pre>
<p>to set up the config file.</p>
<p>Find the config file by running <code>rclone -h</code> and looking for the help for the <code>--config</code> option</p>
<pre><code>$ rclone -h
[snip]
--config="/home/user/.rclone.conf": Config file.
[snip]</code></pre>
<p>Now transfer it to the remote box (scp, cut paste, ftp, sftp etc) and place it in the correct place (use <code>rclone -h</code> on the remote box to find out where).</p>
<h1 id="filtering-includes-and-excludes">Filtering, includes and excludes</h1>
<p>Rclone has a sophisticated set of include and exclude rules. Some of these are based on patterns and some on other things like file size.</p>
<p>The filters are applied for the <code>copy</code>, <code>sync</code>, <code>move</code>, <code>ls</code>, <code>lsl</code>, <code>md5sum</code>, <code>sha1sum</code>, <code>size</code>, <code>delete</code> and <code>check</code> operations. Note that <code>purge</code> does not obey the filters.</p>
<p>Each path as it passes through rclone is matched against the include and exclude rules like <code>--include</code>, <code>--exclude</code>, <code>--include-from</code>, <code>--exclude-from</code>, <code>--filter</code>, or <code>--filter-from</code>. The simplest way to try them out is using the <code>ls</code> command, or <code>--dry-run</code> together with <code>-v</code>.</p>
<h2 id="patterns">Patterns</h2>
<p>The patterns used to match files for inclusion or exclusion are based on "file globs" as used by the unix shell.</p>
<p>If the pattern starts with a <code>/</code> then it only matches at the top level of the directory tree, relative to the root of the remote. If it doesn't start with <code>/</code> then it is matched starting at the <strong>end of the path</strong>, but it will only match a complete path element:</p>
<pre><code>file.jpg - matches "file.jpg"
- matches "directory/file.jpg"
- doesn't match "afile.jpg"
- doesn't match "directory/afile.jpg"
/file.jpg - matches "file.jpg" in the root directory of the remote
- doesn't match "afile.jpg"
- doesn't match "directory/file.jpg"</code></pre>
<p><strong>Important</strong> Note that you must use <code>/</code> in patterns and not <code>\</code> even if running on Windows.</p>
<p>A <code>*</code> matches anything but not a <code>/</code>.</p>
<pre><code>*.jpg - matches "file.jpg"
- matches "directory/file.jpg"
- doesn't match "file.jpg/something"</code></pre>
<p>Use <code>**</code> to match anything, including slashes (<code>/</code>).</p>
<pre><code>dir/** - matches "dir/file.jpg"
- matches "dir/dir1/dir2/file.jpg"
- doesn't match "directory/file.jpg"
- doesn't match "adir/file.jpg"</code></pre>
<p>A <code>?</code> matches any character except a slash <code>/</code>.</p>
<pre><code>l?ss - matches "less"
- matches "lass"
- doesn't match "floss"</code></pre>
<p>A <code>[</code> and <code>]</code> together make a a character class, such as <code>[a-z]</code> or <code>[aeiou]</code> or <code>[[:alpha:]]</code>. See the <a href="https://golang.org/pkg/regexp/syntax/">go regexp docs</a> for more info on these.</p>
<pre><code>h[ae]llo - matches "hello"
- matches "hallo"
- doesn't match "hullo"</code></pre>
<p>A <code>{</code> and <code>}</code> define a choice between elements. It should contain a comma seperated list of patterns, any of which might match. These patterns can contain wildcards.</p>
<pre><code>{one,two}_potato - matches "one_potato"
- matches "two_potato"
- doesn't match "three_potato"
- doesn't match "_potato"</code></pre>
<p>Special characters can be escaped with a <code>\</code> before them.</p>
<pre><code>\*.jpg - matches "*.jpg"
\\.jpg - matches "\.jpg"
\[one\].jpg - matches "[one].jpg"</code></pre>
<h3 id="differences-between-rsync-and-rclone-patterns">Differences between rsync and rclone patterns</h3>
<p>Rclone implements bash style <code>{a,b,c}</code> glob matching which rsync doesn't.</p>
<p>Rclone ignores <code>/</code> at the end of a pattern.</p>
<p>Rclone always does a wildcard match so <code>\</code> must always escape a <code>\</code>.</p>
<h2 id="how-the-rules-are-used">How the rules are used</h2>
<p>Rclone maintains a list of include rules and exclude rules.</p>
<p>Each file is matched in order against the list until it finds a match. The file is then included or excluded according to the rule type.</p>
<p>If the matcher falls off the bottom of the list then the path is included.</p>
<p>For example given the following rules, <code>+</code> being include, <code>-</code> being exclude,</p>
<pre><code>- secret*.jpg
+ *.jpg
+ *.png
+ file2.avi
- *</code></pre>
<p>This would include</p>
<ul>
<li><code>file1.jpg</code></li>
<li><code>file3.png</code></li>
<li><code>file2.avi</code></li>
</ul>
<p>This would exclude</p>
<ul>
<li><code>secret17.jpg</code></li>
<li>non <code>*.jpg</code> and <code>*.png</code></li>
</ul>
<h2 id="adding-filtering-rules">Adding filtering rules</h2>
<p>Filtering rules are added with the following command line flags.</p>
<h3 id="exclude---exclude-files-matching-pattern"><code>--exclude</code> - Exclude files matching pattern</h3>
<p>Add a single exclude rule with <code>--exclude</code>.</p>
<p>Eg <code>--exclude *.bak</code> to exclude all bak files from the sync.</p>
<h3 id="exclude-from---read-exclude-patterns-from-file"><code>--exclude-from</code> - Read exclude patterns from file</h3>
<p>Add exclude rules from a file.</p>
<p>Prepare a file like this <code>exclude-file.txt</code></p>
<pre><code># a sample exclude rule file
*.bak
file2.jpg</code></pre>
<p>Then use as <code>--exclude-from exclude-file.txt</code>. This will sync all files except those ending in <code>bak</code> and <code>file2.jpg</code>.</p>
<p>This is useful if you have a lot of rules.</p>
<h3 id="include---include-files-matching-pattern"><code>--include</code> - Include files matching pattern</h3>
<p>Add a single include rule with <code>--include</code>.</p>
<p>Eg <code>--include *.{png,jpg}</code> to include all <code>png</code> and <code>jpg</code> files in the backup and no others.</p>
<p>This adds an implicit <code>--exclude *</code> at the very end of the filter list. This means you can mix <code>--include</code> and <code>--include-from</code> with the other filters (eg <code>--exclude</code>) but you must include all the files you want in the include statement. If this doesn't provide enough flexibility then you must use <code>--filter-from</code>.</p>
<h3 id="include-from---read-include-patterns-from-file"><code>--include-from</code> - Read include patterns from file</h3>
<p>Add include rules from a file.</p>
<p>Prepare a file like this <code>include-file.txt</code></p>
<pre><code># a sample include rule file
*.jpg
*.png
file2.avi</code></pre>
<p>Then use as <code>--include-from include-file.txt</code>. This will sync all <code>jpg</code>, <code>png</code> files and <code>file2.avi</code>.</p>
<p>This is useful if you have a lot of rules.</p>
<p>This adds an implicit <code>--exclude *</code> at the very end of the filter list. This means you can mix <code>--include</code> and <code>--include-from</code> with the other filters (eg <code>--exclude</code>) but you must include all the files you want in the include statement. If this doesn't provide enough flexibility then you must use <code>--filter-from</code>.</p>
<h3 id="filter---add-a-file-filtering-rule"><code>--filter</code> - Add a file-filtering rule</h3>
<p>This can be used to add a single include or exclude rule. Include rules start with <code>+</code> and exclude rules start with <code>-</code>. A special rule called <code>!</code> can be used to clear the existing rules.</p>
<p>Eg <code>--filter "- *.bak"</code> to exclude all bak files from the sync.</p>
<h3 id="filter-from---read-filtering-patterns-from-a-file"><code>--filter-from</code> - Read filtering patterns from a file</h3>
<p>Add include/exclude rules from a file.</p>
<p>Prepare a file like this <code>filter-file.txt</code></p>
<pre><code># a sample exclude rule file
- secret*.jpg
+ *.jpg
+ *.png
+ file2.avi
# exclude everything else
- *</code></pre>
<p>Then use as <code>--filter-from filter-file.txt</code>. The rules are processed in the order that they are defined.</p>
<p>This example will include all <code>jpg</code> and <code>png</code> files, exclude any files matching <code>secret*.jpg</code> and include <code>file2.avi</code>. Everything else will be excluded from the sync.</p>
<h3 id="files-from---read-list-of-source-file-names"><code>--files-from</code> - Read list of source-file names</h3>
<p>This reads a list of file names from the file passed in and <strong>only</strong> these files are transferred. The filtering rules are ignored completely if you use this option.</p>
<p>Prepare a file like this <code>files-from.txt</code></p>
<pre><code># comment
file1.jpg
file2.jpg</code></pre>
<p>Then use as <code>--files-from files-from.txt</code>. This will only transfer <code>file1.jpg</code> and <code>file2.jpg</code> providing they exist.</p>
<h3 id="min-size---dont-transfer-any-file-smaller-than-this"><code>--min-size</code> - Don't transfer any file smaller than this</h3>
<p>This option controls the minimum size file which will be transferred. This defaults to <code>kBytes</code> but a suffix of <code>k</code>, <code>M</code>, or <code>G</code> can be used.</p>
<p>For example <code>--min-size 50k</code> means no files smaller than 50kByte will be transferred.</p>
<h3 id="max-size---dont-transfer-any-file-larger-than-this"><code>--max-size</code> - Don't transfer any file larger than this</h3>
<p>This option controls the maximum size file which will be transferred. This defaults to <code>kBytes</code> but a suffix of <code>k</code>, <code>M</code>, or <code>G</code> can be used.</p>
<p>For example <code>--max-size 1G</code> means no files larger than 1GByte will be transferred.</p>
<h3 id="max-age---dont-transfer-any-file-older-than-this"><code>--max-age</code> - Don't transfer any file older than this</h3>
<p>This option controls the maximum age of files to transfer. Give in seconds or with a suffix of:</p>
<ul>
<li><code>ms</code> - Milliseconds</li>
<li><code>s</code> - Seconds</li>
<li><code>m</code> - Minutes</li>
<li><code>h</code> - Hours</li>
<li><code>d</code> - Days</li>
<li><code>w</code> - Weeks</li>
<li><code>M</code> - Months</li>
<li><code>y</code> - Years</li>
</ul>
<p>For example <code>--max-age 2d</code> means no files older than 2 days will be transferred.</p>
<h3 id="min-age---dont-transfer-any-file-younger-than-this"><code>--min-age</code> - Don't transfer any file younger than this</h3>
<p>This option controls the minimum age of files to transfer. Give in seconds or with a suffix (see <code>--max-age</code> for list of suffixes)</p>
<p>For example <code>--min-age 2d</code> means no files younger than 2 days will be transferred.</p>
<h3 id="delete-excluded---delete-files-on-dest-excluded-from-sync"><code>--delete-excluded</code> - Delete files on dest excluded from sync</h3>
<p><strong>Important</strong> this flag is dangerous - use with <code>--dry-run</code> and <code>-v</code> first.</p>
<p>When doing <code>rclone sync</code> this will delete any files which are excluded from the sync on the destination.</p>
<p>If for example you did a sync from <code>A</code> to <code>B</code> without the <code>--min-size 50k</code> flag</p>
<pre><code>rclone sync A: B:</code></pre>
<p>Then you repeated it like this with the <code>--delete-excluded</code></p>
<pre><code>rclone --min-size 50k --delete-excluded sync A: B:</code></pre>
<p>This would delete all files on <code>B</code> which are less than 50 kBytes as these are now excluded from the sync.</p>
<p>Always test first with <code>--dry-run</code> and <code>-v</code> before using this flag.</p>
<h3 id="dump-filters---dump-the-filters-to-the-output"><code>--dump-filters</code> - dump the filters to the output</h3>
<p>This dumps the defined filters to the output as regular expressions.</p>
<p>Useful for debugging.</p>
<h2 id="quoting-shell-metacharacters">Quoting shell metacharacters</h2>
<p>The examples above may not work verbatim in your shell as they have shell metacharacters in them (eg <code>*</code>), and may require quoting.</p>
<p>Eg linux, OSX</p>
<ul>
<li><code>--include \*.jpg</code></li>
<li><code>--include '*.jpg'</code></li>
<li><code>--include='*.jpg'</code></li>
</ul>
<p>In Windows the expansion is done by the command not the shell so this should work fine</p>
<ul>
<li><code>--include *.jpg</code></li>
</ul>
<h1 id="overview-of-cloud-storage-systems">Overview of cloud storage systems</h1>
<p>Each cloud storage system is slighly different. Rclone attempts to provide a unified interface to them, but some underlying differences show through.</p>
<h2 id="features">Features</h2>
<p>Here is an overview of the major features of each cloud storage system.</p>
<table>
<thead>
<tr class="header">
<th align="left">Name</th>
<th align="center">Hash</th>
<th align="center">ModTime</th>
<th align="center">Case Insensitive</th>
<th align="center">Duplicate Files</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td align="left">Google Drive</td>
<td align="center">MD5</td>
<td align="center">Yes</td>
<td align="center">No</td>
<td align="center">Yes</td>
</tr>
<tr class="even">
<td align="left">Amazon S3</td>
<td align="center">MD5</td>
<td align="center">Yes</td>
<td align="center">No</td>
<td align="center">No</td>
</tr>
<tr class="odd">
<td align="left">Openstack Swift</td>
<td align="center">MD5</td>
<td align="center">Yes</td>
<td align="center">No</td>
<td align="center">No</td>
</tr>
<tr class="even">
<td align="left">Dropbox</td>
<td align="center">-</td>
<td align="center">No</td>
<td align="center">Yes</td>
<td align="center">No</td>
</tr>
<tr class="odd">
<td align="left">Google Cloud Storage</td>
<td align="center">MD5</td>
<td align="center">Yes</td>
<td align="center">No</td>
<td align="center">No</td>
</tr>
<tr class="even">
<td align="left">Amazon Cloud Drive</td>
<td align="center">MD5</td>
<td align="center">No</td>
<td align="center">Yes</td>
<td align="center">No</td>
</tr>
<tr class="odd">
<td align="left">Microsoft One Drive</td>
<td align="center">SHA1</td>
<td align="center">Yes</td>
<td align="center">Yes</td>
<td align="center">No</td>
</tr>
<tr class="even">
<td align="left">Hubic</td>
<td align="center">MD5</td>
<td align="center">Yes</td>
<td align="center">No</td>
<td align="center">No</td>
</tr>
<tr class="odd">
<td align="left">Backblaze B2</td>
<td align="center">SHA1</td>
<td align="center">Yes</td>
<td align="center">No</td>
<td align="center">No</td>
</tr>
<tr class="even">
<td align="left">Yandex Disk</td>
<td align="center">MD5</td>
<td align="center">Yes</td>
<td align="center">No</td>
<td align="center">No</td>
</tr>
<tr class="odd">
<td align="left">The local filesystem</td>
<td align="center">All</td>
<td align="center">Yes</td>
<td align="center">Depends</td>
<td align="center">No</td>
</tr>
</tbody>
</table>
<h3 id="hash">Hash</h3>
<p>The cloud storage system supports various hash types of the objects.<br />The hashes are used when transferring data as an integrity check and can be specifically used with the <code>--checksum</code> flag in syncs and in the <code>check</code> command.</p>
<p>To use the checksum checks between filesystems they must support a common hash type.</p>
<h3 id="modtime">ModTime</h3>
<p>The cloud storage system supports setting modification times on objects. If it does then this enables a using the modification times as part of the sync. If not then only the size will be checked by default, though the MD5SUM can be checked with the <code>--checksum</code> flag.</p>
<p>All cloud storage systems support some kind of date on the object and these will be set when transferring from the cloud storage system.</p>
<h3 id="case-insensitive">Case Insensitive</h3>
<p>If a cloud storage systems is case sensitive then it is possible to have two files which differ only in case, eg <code>file.txt</code> and <code>FILE.txt</code>. If a cloud storage system is case insensitive then that isn't possible.</p>
<p>This can cause problems when syncing between a case insensitive system and a case sensitive system. The symptom of this is that no matter how many times you run the sync it never completes fully.</p>
<p>The local filesystem may or may not be case sensitive depending on OS.</p>
<ul>
<li>Windows - usually case insensitive, though case is preserved</li>
<li>OSX - usually case insensitive, though it is possible to format case sensitive</li>
<li>Linux - usually case sensitive, but there are case insensitive file systems (eg FAT formatted USB keys)</li>
</ul>
<p>Most of the time this doesn't cause any problems as people tend to avoid files whose name differs only by case even on case sensitive systems.</p>
<h3 id="duplicate-files">Duplicate files</h3>
<p>If a cloud storage system allows duplicate files then it can have two objects with the same name.</p>
<p>This confuses rclone greatly when syncing - use the <code>rclone dedupe</code> command to rename or remove duplicates.</p>
<h2 id="google-drive">Google Drive</h2>
<p>Paths are specified as <code>drive:path</code></p>
<p>Drive paths may be as deep as required, eg <code>drive:directory/subdirectory</code>.</p>
<p>The initial setup for drive involves getting a token from Google drive which you need to do in your browser. <code>rclone config</code> walks you through it.</p>
<p>Here is an example of how to make a remote called <code>remote</code>. First run:</p>
<pre><code> rclone config</code></pre>
<p>This will guide you through an interactive setup process:</p>
<pre><code>n) New remote
d) Delete remote
q) Quit config
e/n/d/q> n
name> remote
Type of storage to configure.
Choose a number from below, or type in your own value
1 / Amazon Cloud Drive
\ "amazon cloud drive"
2 / Amazon S3 (also Dreamhost, Ceph)
\ "s3"
3 / Backblaze B2
\ "b2"
4 / Dropbox
\ "dropbox"
5 / Google Cloud Storage (this is not Google Drive)
\ "google cloud storage"
6 / Google Drive
\ "drive"
7 / Hubic
\ "hubic"
8 / Local Disk
\ "local"
9 / Microsoft OneDrive
\ "onedrive"
10 / Openstack Swift (Rackspace Cloud Files, Memset Memstore, OVH)
\ "swift"
11 / Yandex Disk
\ "yandex"
Storage> 6
Google Application Client Id - leave blank normally.
client_id>
Google Application Client Secret - leave blank normally.
client_secret>
Remote config
Use auto config?
* Say Y if not sure
* Say N if you are working on a remote or headless machine or Y didn't work
y) Yes
n) No
y/n> y
If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth
Log in and authorize rclone for access
Waiting for code...
Got code
--------------------
[remote]
client_id =
client_secret =
token = {"AccessToken":"xxxx.x.xxxxx_xxxxxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","RefreshToken":"1/xxxxxxxxxxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxx","Expiry":"2014-03-16T13:57:58.955387075Z","Extra":null}
--------------------
y) Yes this is OK
e) Edit this remote
d) Delete this remote
y/e/d> y</code></pre>
<p>Note that rclone runs a webserver on your local machine to collect the token as returned from Google if you use auto config mode. This only runs from the moment it opens your browser to the moment you get back the verification code. This is on <code>http://127.0.0.1:53682/</code> and this it may require you to unblock it temporarily if you are running a host firewall, or use manual mode.</p>
<p>You can then use it like this,</p>
<p>List directories in top level of your drive</p>
<pre><code>rclone lsd remote:</code></pre>
<p>List all the files in your drive</p>
<pre><code>rclone ls remote:</code></pre>
<p>To copy a local directory to a drive directory called backup</p>
<pre><code>rclone copy /home/source remote:backup</code></pre>
<h3 id="modified-time">Modified time</h3>
<p>Google drive stores modification times accurate to 1 ms.</p>
<h3 id="revisions">Revisions</h3>
<p>Google drive stores revisions of files. When you upload a change to an existing file to google drive using rclone it will create a new revision of that file.</p>
<p>Revisions follow the standard google policy which at time of writing was</p>
<ul>
<li>They are deleted after 30 days or 100 revisions (whatever comes first).</li>
<li>They do not count towards a user storage quota.</li>
</ul>
<h3 id="deleting-files">Deleting files</h3>
<p>By default rclone will delete files permanently when requested. If sending them to the trash is required instead then use the <code>--drive-use-trash</code> flag.</p>
<h3 id="specific-options">Specific options</h3>
<p>Here are the command line options specific to this cloud storage system.</p>
<h4 id="drive-chunk-sizesize">--drive-chunk-size=SIZE</h4>
<p>Upload chunk size. Must a power of 2 >= 256k. Default value is 8 MB.</p>
<p>Making this larger will improve performance, but note that each chunk is buffered in memory one per transfer.</p>
<p>Reducing this will reduce memory usage but decrease performance.</p>
<h4 id="drive-full-list">--drive-full-list</h4>
<p>No longer does anything - kept for backwards compatibility.</p>
<h4 id="drive-upload-cutoffsize">--drive-upload-cutoff=SIZE</h4>
<p>File size cutoff for switching to chunked upload. Default is 8 MB.</p>
<h4 id="drive-use-trash">--drive-use-trash</h4>
<p>Send files to the trash instead of deleting permanently. Defaults to off, namely deleting files permanently.</p>
<h4 id="drive-auth-owner-only">--drive-auth-owner-only</h4>
<p>Only consider files owned by the authenticated user. Requires that --drive-full-list=true (default).</p>
<h4 id="drive-formats">--drive-formats</h4>
<p>Google documents can only be exported from Google drive. When rclone downloads a Google doc it chooses a format to download depending upon this setting.</p>
<p>By default the formats are <code>docx,xlsx,pptx,svg</code> which are a sensible default for an editable document.</p>
<p>When choosing a format, rclone runs down the list provided in order and chooses the first file format the doc can be exported as from the list. If the file can't be exported to a format on the formats list, then rclone will choose a format from the default list.</p>
<p>If you prefer an archive copy then you might use <code>--drive-formats pdf</code>, or if you prefer openoffice/libreoffice formats you might use <code>--drive-formats ods,odt</code>.</p>
<p>Note that rclone adds the extension to the google doc, so if it is calles <code>My Spreadsheet</code> on google docs, it will be exported as <code>My Spreadsheet.xlsx</code> or <code>My Spreadsheet.pdf</code> etc.</p>
<p>Here are the possible extensions with their corresponding mime types.</p>
<table>
<thead>
<tr class="header">
<th align="left">Extension</th>
<th align="left">Mime Type</th>
<th align="left">Description</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td align="left">csv</td>
<td align="left">text/csv</td>
<td align="left">Standard CSV format for Spreadsheets</td>
</tr>
<tr class="even">
<td align="left">doc</td>
<td align="left">application/msword</td>
<td align="left">Micosoft Office Document</td>
</tr>
<tr class="odd">
<td align="left">docx</td>
<td align="left">application/vnd.openxmlformats-officedocument.wordprocessingml.document</td>
<td align="left">Microsoft Office Document</td>
</tr>
<tr class="even">
<td align="left">html</td>
<td align="left">text/html</td>
<td align="left">An HTML Document</td>
</tr>
<tr class="odd">
<td align="left">jpg</td>
<td align="left">image/jpeg</td>
<td align="left">A JPEG Image File</td>
</tr>
<tr class="even">
<td align="left">ods</td>
<td align="left">application/vnd.oasis.opendocument.spreadsheet</td>
<td align="left">Openoffice Spreadsheet</td>
</tr>
<tr class="odd">
<td align="left">ods</td>
<td align="left">application/x-vnd.oasis.opendocument.spreadsheet</td>
<td align="left">Openoffice Spreadsheet</td>
</tr>
<tr class="even">
<td align="left">odt</td>
<td align="left">application/vnd.oasis.opendocument.text</td>
<td align="left">Openoffice Document</td>
</tr>
<tr class="odd">
<td align="left">pdf</td>
<td align="left">application/pdf</td>
<td align="left">Adobe PDF Format</td>
</tr>
<tr class="even">
<td align="left">png</td>
<td align="left">image/png</td>
<td align="left">PNG Image Format</td>
</tr>
<tr class="odd">
<td align="left">pptx</td>
<td align="left">application/vnd.openxmlformats-officedocument.presentationml.presentation</td>
<td align="left">Microsoft Office Powerpoint</td>
</tr>
<tr class="even">
<td align="left">rtf</td>
<td align="left">application/rtf</td>
<td align="left">Rich Text Format</td>
</tr>
<tr class="odd">
<td align="left">svg</td>
<td align="left">image/svg+xml</td>
<td align="left">Scalable Vector Graphics Format</td>
</tr>
<tr class="even">
<td align="left">txt</td>
<td align="left">text/plain</td>
<td align="left">Plain Text</td>
</tr>
<tr class="odd">
<td align="left">xls</td>
<td align="left">application/vnd.ms-excel</td>
<td align="left">Microsoft Office Spreadsheet</td>
</tr>
<tr class="even">
<td align="left">xlsx</td>
<td align="left">application/vnd.openxmlformats-officedocument.spreadsheetml.sheet</td>
<td align="left">Microsoft Office Spreadsheet</td>
</tr>
<tr class="odd">
<td align="left">zip</td>
<td align="left">application/zip</td>
<td align="left">A ZIP file of HTML, Images CSS</td>
</tr>
</tbody>
</table>
<h3 id="limitations">Limitations</h3>
<p>Drive has quite a lot of rate limiting. This causes rclone to be limited to transferring about 2 files per second only. Individual files may be transferred much faster at 100s of MBytes/s but lots of small files can take a long time.</p>
<h2 id="amazon-s3">Amazon S3</h2>
<p>Paths are specified as <code>remote:bucket</code> (or <code>remote:</code> for the <code>lsd</code> command.) You may put subdirectories in too, eg <code>remote:bucket/path/to/dir</code>.</p>
<p>Here is an example of making an s3 configuration. First run</p>
<pre><code>rclone config</code></pre>
<p>This will guide you through an interactive setup process.</p>
<pre><code>No remotes found - make a new one
n) New remote
s) Set configuration password
n/s> n
name> remote
Type of storage to configure.
Choose a number from below, or type in your own value
1 / Amazon Cloud Drive
\ "amazon cloud drive"
2 / Amazon S3 (also Dreamhost, Ceph)
\ "s3"
3 / Backblaze B2
\ "b2"
4 / Dropbox
\ "dropbox"
5 / Google Cloud Storage (this is not Google Drive)
\ "google cloud storage"
6 / Google Drive
\ "drive"
7 / Hubic
\ "hubic"
8 / Local Disk
\ "local"
9 / Microsoft OneDrive
\ "onedrive"
10 / Openstack Swift (Rackspace Cloud Files, Memset Memstore, OVH)
\ "swift"
11 / Yandex Disk
\ "yandex"
Storage> 2
Get AWS credentials from runtime (environment variables or EC2 meta data if no env vars). Only applies if access_key_id and secret_access_key is blank.
Choose a number from below, or type in your own value
1 / Enter AWS credentials in the next step
\ "false"
2 / Get AWS credentials from the environment (env vars or IAM)
\ "true"
env_auth> 1
AWS Access Key ID - leave blank for anonymous access or runtime credentials.
access_key_id> access_key
AWS Secret Access Key (password) - leave blank for anonymous access or runtime credentials.
secret_access_key> secret_key
Region to connect to.
Choose a number from below, or type in your own value
/ The default endpoint - a good choice if you are unsure.
1 | US Region, Northern Virginia or Pacific Northwest.
| Leave location constraint empty.
\ "us-east-1"
/ US West (Oregon) Region
2 | Needs location constraint us-west-2.
\ "us-west-2"
/ US West (Northern California) Region
3 | Needs location constraint us-west-1.
\ "us-west-1"
/ EU (Ireland) Region Region
4 | Needs location constraint EU or eu-west-1.
\ "eu-west-1"
/ EU (Frankfurt) Region
5 | Needs location constraint eu-central-1.
\ "eu-central-1"
/ Asia Pacific (Singapore) Region
6 | Needs location constraint ap-southeast-1.
\ "ap-southeast-1"
/ Asia Pacific (Sydney) Region
7 | Needs location constraint ap-southeast-2.
\ "ap-southeast-2"
/ Asia Pacific (Tokyo) Region
8 | Needs location constraint ap-northeast-1.
\ "ap-northeast-1"
/ South America (Sao Paulo) Region
9 | Needs location constraint sa-east-1.
\ "sa-east-1"
/ If using an S3 clone that only understands v2 signatures
10 | eg Ceph/Dreamhost
| set this and make sure you set the endpoint.
\ "other-v2-signature"
/ If using an S3 clone that understands v4 signatures set this
11 | and make sure you set the endpoint.
\ "other-v4-signature"
region> 1
Endpoint for S3 API.
Leave blank if using AWS to use the default endpoint for the region.
Specify if using an S3 clone such as Ceph.
endpoint>
Location constraint - must be set to match the Region. Used when creating buckets only.
Choose a number from below, or type in your own value
1 / Empty for US Region, Northern Virginia or Pacific Northwest.
\ ""
2 / US West (Oregon) Region.
\ "us-west-2"
3 / US West (Northern California) Region.
\ "us-west-1"
4 / EU (Ireland) Region.
\ "eu-west-1"
5 / EU Region.
\ "EU"